As the official tutorial about generics type erasure, and this statement is so confusing me. When the type cast inserting might occur exactly? I tried with some simple usages of generics and using javap -c a.class
to check the bytecode but it seems no typecasting inserted as I expected.
The so-called duplicated is more about the bridge method using a type cast to ensure there is proper polymorphism
while I am wondering what the second statement means exactly.
Insert type casts if necessary to preserve type safety.
Any example could be provided to demonstrate it?