Are there any methods to do so? I was looking but couldn\'t find any.
Another question: I need these methods so I can filter files.
Some are AND
filter
I think you should use a Set
to hold the files if you want to do intersection and union on them. Then you can use Guava's Sets class to do union
, intersection
and filtering by a Predicate
as well. The difference between these methods and the other suggestions is that all of these methods create lazy views of the union, intersection, etc. of the two sets. Apache Commons creates a new collection and copies data to it. retainAll
changes one of your collections by removing elements from it.