Possible Duplicate:
Why aren't Java Collections remove methods generic?
Does anyone know why MyDamnedUnclearList.remove() methods take Object element and not T element (or V extends T element) ?
I lost two hours to find a bug mixing both int and Integer Java types (in a List<Thread> list…
The issue has to do with backward compatibility of existing code and specification.
What are the reasons why Map.get(Object key) is not (fully) generic
Its all in the details of the Javadoc:
So you see it doesn’t matter whether the objects have the same type only that they equal.