Does anyone know the reason that, while the add operations on collections (.add( foo ), .put( foo, bar ), .offer( foo ), etc) are genericised, other operations like .remove( foo ) and .contains( foo ) are not?
The only reason I can come up with is that it is more convenient, as you don’t have to instanceof and cast if all you have is an Object, at the expense of compile-time safety (Say you change a List to a List, all of your calls to add( foo ) are now compilation errors, but any remove() and contains() calls that you missed in the change will now cause non-obvious runtime errors).
Is there a better reason? Or am I just on the swings side of this tradeoff, and everyone else is having a great time on the roundabouts?