I\'ve seen similar questions but they didnt help very much.
For instance I\'ve got this Generic Class:
public class ContainerTest
{
public
To learn the value of T
you'll need to capture it in a type definition by subclassing ContainerTest:
class MyStringClass extends ContainerTest {}
You can also do this with an anonymous class if you want:
ContainerTest myStringClass = new ContainerTest{}();
Then to resolve the value of T, you can use TypeTools:
Class> stringType = TypeResolver.resolveRawArgument(ContainerTest.class, myStringClass.getClass());
assert stringType == String.class;