I would like to filter out my collection using multiple filters.
Let's assume I have a list of Strings and a function filter()
to filter out empty Strings.
List<String> myList = .......
Typically, I would use streams like this:
myList.stream()
.filter(elem -> filterOut(elem))
.collect(Collectors.toList());
How to apply multiple filters from a collection (List
or Set
) using streams?
Set<Predicate> myFilters = .....