Modifying this test to make the method private fails --
import org.testng.annotations.Test;
import static org.testng.Assert.assertEquals;
/**
* @author Robert Field
*/
@Test
public class MethodReferenceTestTypeConversion {
class MethodReferenceTestTypeConversion_E<T> {
private T xI(T t) { return t; }
}
interface ISi { int m(Short a); }
interface ICc { char m(Character a); }
public void testUnboxObjectToNumberWiden() {
ISi q = (new MethodReferenceTestTypeConversion_E<Short>())::xI;
assertEquals(q.m((short)77), (short)77);
}
public void testUnboxObjectToChar() {
ICc q = (new MethodReferenceTestTypeConversion_E<Character>())::xI;
assertEquals(q.m('@'), '@');
}
}