Earlier quoted context omitted.
for (i = ctr_size(container); i--; ) if (!predicate(container, i)) ctr_remove(container, i);
filter predicate xs :)
CollectionUtils.filter(collection, predicate);
Of course aside from being a bit more verbose, predicate needs to be an object (often a singleton), because you can't pass around functions.