Generics are checked at compile-time** **for type-correctness. The generic type information is then removed in a process called type erasure. You can (almost) think of it as a source-to-source translation. You can use it to add type-safety check to your code, and avoid exceptions due to type problems during execution.
https://www.learneroo.com/modules/83/nodes/441