20.3 Generic Methods: Implementation and Compile-Time Translation
If the operations performed by several overloaded methods are identical for each argument type, the overloaded methods can be more conveniently coded using a generic method. You can write a single generic method declaration that can be called with arguments of different types. Based on the types of the arguments passed to the generic method, the compiler handles each method call appropriately. At compilation time, the compiler ensures the type safety of your code, preventing many runtime errors.