class MyTest { MyTest(E e) { } interface I { MyTest m(T t); } static void bar(Y arg, I i) { i.m(arg); } static void bar(I i, Y arg) { i.m(arg); } static void bar(I i) { i.m(null); } public static void main(String[] args) { I i = MyTest::new; bar("", MyTest::new); bar("", MyTest::new); bar(MyTest::new, ""); bar(MyTest::new, ""); bar(MyTest::new); bar(MyTest::new); } }