As already noted, you can't use the 'new' expression to create a new object at runtime given the way generics are implemented in Java. IMO, the cleanest (type-safe without any warning) approach you can come across can be achieved by passing in the class of the object you have to create. E.g.
private static <T> T addToList(List<T> list, Class<T> klass) {
T t = null;
try {
t = klass.newInstance();
list.add(t);
} catch (Exception e) {
e.printStackTrace();
}
return t;
}
But then again, I personally think that having a method given the arbitrary responsibility of creating objects and inserting into Lists is a bit off. Any "practical" scenario you have in mind which requires you to have true generics?