Skip to content

Instantly share code, notes, and snippets.

@darrenbkl
Created January 16, 2020 15:01
Show Gist options
  • Save darrenbkl/4448ef9cd8d577601f060819c2d0c5d2 to your computer and use it in GitHub Desktop.
Save darrenbkl/4448ef9cd8d577601f060819c2d0c5d2 to your computer and use it in GitHub Desktop.
<T> Class<T> getReifiedType(List<T> object) {
return object.getClass(); // return List<String>.class
}
public <T> boolean isListOfString(List<T> object) {
return object instanceof List<String>.class; // return true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment