import java.util.List; public class InlineSingleImplementation { interface MyIface { void mySimpleMethod(); } static class MyIfaceImpl implements MyIface { @Override public void mySimpleMethod() { System.out.println("Impl"); } } void test(MyIface iface) { iface.mySimpleMethod(); } }