public class InlineSingleImplementation { interface MyIface { void myUseGenericMethod(T t); } static class MyIfaceImpl implements MyIface { @Override public void myUseGenericMethod(E e) { E e1 = e; System.out.println("Impl: " + e); } } void test(MyIface iface) { String e1 = "hello"; System.out.println("Impl: " + "hello"); } }