public class Main { 
    private interface SetString<E> { 
        void setValue(E target, String value); 
    } 
    private interface SetInteger<E> { 
        void setValue(E target, Integer value); 
    } 

    private static class A<T> { // if we remove <T>, it will work 
        public void setString(String string) {} 
    } 

    private static <E> void doSomething(SetString<E> a) {} 
    private static <E> void doSomething(SetInteger<E> a) {} 

    public static void main(String[] args) { 
        doSomething(A::setString); // error here. If we make A<SomeClass>, it will work 
    } 
} 