From https://stackoverflow.com/a/31876747
In Java generics, a generic type definition is transformed to essentially one concrete generic type shared across all allowed type argument combinations. Thus, multiple (source code level) types are mapped to one (binary level) type - but as a result, information about the type arguments of an instance is discarded in that instance (type erasure).
Type information that could have been available at runtime (using reflection) is lost. This, in turn, means that specialization of a generic type (the ability to use specialized source code for any particular generic argument combination) is very restricted.
What are the consequences of "Type information that could have been available at runtime (using reflection) is lost"?
What does it means by "specialization of a generic type (the ability to use specialized source code for any particular generic argument combination) is very restricted"?
Maybe some examples?
Thanks.