Since generics were introduced, Class is parametrized, so that List.class produces Class. This is clear.
What I am not able to figure out is how to get a in
I don't think that you can do what you are trying. Firstly, your instantiate method doesn't know that its dealing with a parameterised type (you could just as easily pass it java.util.Date.class). Secondly, because of erasure, doing anything particularly specific with parameterised types at runtime is difficult or impossible.
If you were to approach the problem in a different way, there are other little tricks that you can do, like type inference:
public class GenTest
{
private static List createList()
{
return new ArrayList();
}
public static void main(String[] args)
{
List list = createList();
List list2 = createList();
}
}