This is because when you work with a general class without additional type information, you work with what is sometimes called the degenerate form of a class. The degenerate form deletes ALL data of a general type.
Essentially - your class becomes something like:
public class GenericClass { public void put(Class key, Object value) {
Thus, it is expected that the expected compiler response will be expected.
It is mentioned in Java Puzzlers .
source share