class MyTest { static class Foo { T m() { return null; } } interface I { Integer m(Foo f); } public static void main(String[] args) { I i = Foo::m; } } class MyTest1 { interface I1 { void m(String s); } interface I2 { void m(Integer i); } interface I3 { void m(Object o); } static class Foo { Foo(T t) {} } static void foo(I1 i) {} static void foo(I2 i) {} static void foo(I3 i) {} static { foo(Foo::new); } }