Is it possible to get the type of a generic parameter?
An example:
public final class Voodoo {
public static void chill(List> aListWithTy
The quick answer the the Question is no you can't, because of Java generic type erasure.
The longer answer would be that if you have created your list like this:
new ArrayList(){}
Then in this case the generic type is preserved in the generic superclass of the new anonymous class above.
Not that I recommend doing this with lists, but it is a listener implementation:
new Listener() { public void doSomething(Type t){...}}
And since extrapolating the generic types of super classes and super interfaces change between JVMs, the generic solution is not as straight forward as some answers might suggest.
Here is now I did it.