Check what type a list class is of in java

Viewed 486

Given that I have a

Class<?> clazz

I want to verify if clazz is a list of my specific object

So I started with

if (List.class.isAssignableFrom(type)) {

}

but up till here I only verified that it is List<?>. How can I verify for example it is a List<String>?

1 Answers
Related