import java.util.List; public class InlineSingleImplementation { interface MyIface { M myGenericMethod(M m, T t); } static class MyIfaceImpl implements MyIface { @Override public M1 myGenericMethod(M1 m, E e) { M1 m1 = m; E e1 = e; if (m == null) return null; System.out.println("Impl: " + m1 + " : " + e); return m; } } void test(MyIface iface) { int x = iface.myGenericMethod(123, "hello"); } }