In C++, I can use find_if with a predicate to find an element in a container. Is there something like that in Java? The contains method on collections uses equals and can not be parameterized.
In C++, I can use find_if with a predicate to find an element in
Share
You can use Predicate from Google Collections. Here is the tutorial and an example from it:
You can also look at this thread: What is the best way to filter a Collection?