Consider a generic method that takes two parameterized types.
This works fine even when the type for the first argument is Object and is
String for the second. The output is class [Ljava.lang.String
However, if now the array(second parameter) is replaced by a parameterized list as shown below, a compilation error occurs.
How is the type inferred correctly for the array and not for the collection object?