I would like to know if something like below is possible,
list.removeAll(namesToRemove)
I hope the context is understandable.
The list is of type ArrayList<MyObject> where MyObject has a getName method.
The namesToRemove is an ArrayList<String> containing names of the objects to be removed.
I know this can be achieved by overriding equals method in MyObject class. I would like to know if any other choice is present.
You can do something like this using Google Collections
Collections2.filter():