In Haskell, I can do
filter pred list
To create a new list with elements of list for which the function pred is true. Does the Java API have something similar for java.util.List or other collections? I haven’t been able to find anything in the API docs.
As you maybe able to see from Java doc for List. There is no filter for core API.
I would just iterate through the list and pull whatever you need into a new list.