Campbell: What is wrong with that is that a List<String> never contains Integer objects. If it does, something is very wrong... it should not even be possible to add anything else than String objects to a List<String>. I know it's possible because of type erasure and when you do casts, but... And an array (instead of a List) of Strings can really never contain an Integer, because the JVM checks at runtime what you put into an array. If you try to put an Integer in a String[] you will get an ArrayStoreException.
Also,
you should never create different classes which can be equal() to each other. It will cause you a lot of headaches...
Naresh: If you look at interface java.util.List<E> you'll see that it has a contains() method which takes an Object instead of an E.
This is because of backward compatibility. Generics have not been in the Java language since the start. They were added in Java 5. The collections interfaces and classes have been modified to support generics, but not all changes could be made without breaking backward compatibility. So, Oracle (or Sun at that time) decided to not change the method contains(Object obj) to contains(E obj), because it might have caused a compile error when compiling old code with the new Java version.
If they would redesign the API without regard for backward compatibility, there would probably have been a method contains(E obj) instead, but that's never going to happen - Oracle takes backward compatibility very seriously.