I\'m not sure what the technical term for this is, but consider an interface:
public interface SomeInterface { public T doSomething(); }
As the type parameters are erased at compile time, IMHO you unfortunately cannot achieve what you want without specifying T as the second type parameter, just as you did in your first example.