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; } }