Is there a way in Apache Commons Collections to have a PredicatedList (or similar) which does not throw an IllegalArgumentException if the thing you are trying to add doesn't match the predicate? If it does not match, it would just ignore the request to add the item to the list.
So for example, if I do this:
List predicatedList = ListUtils.predicatedList(new ArrayList(), PredicateUtils.notNullPredicate());
...
predicatedList.add(null); // throws an IllegalArgumentException
I'd like to be able to do the above, but with the adding of null being ignored with no exception thrown.
I can't figure out from the JavaDocs if Commons Collections supports this. I'd like to do this if possible without rolling my own code.