How can I achieve this?
public class GenericClass { public Type getMyType() { //How do I return the type of T? } }
public static final Class> getGenericArgument(final Class> clazz) { return (Class>) ((ParameterizedType) clazz.getGenericSuperclass()).getActualTypeArguments()[0]; }