Possible Duplicate:
How to determine the class of a generic type?
I have a method such as:
public <T> List<T> bar() {
return new Baz<T.class>().toList();
}
T.class
creates a compiler error. Is there some way to do this in Java, or is it impossible because of type erasure?