I want to know the class of a generic return type of a method, something like this:
<T> T getEntry() { System.out.println(T.class) }
The problem is, this is not a generic class, this is just a generic method, so I can't extract the generic type from the class. What I want to achieve is knowing what concrete type the caller wants without requiring the class, like:
<T> T getEntry(Class<?> clazz);
Is that possible?