public class NotAFIT { static class First { static interface A { void foo1(); void foo2(); } static void foo(A a) { } void bar() { foo(() ->{}); } } static class WithInheritance { static interface A { void foo1(); } static interface B extends A { void foo2(); } static void foo(B a) { } void bar() { foo(()->{}); } } static class WithInheritanceOverrideSameMethod { static interface A { void foo1(); } static interface B extends A { void foo1(); } static void foo(B a) { } void bar() { foo(()->{}); } } }