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
In Java 8, I use simple helper methods like this:
public static Collection getIntersection(Collection coll1, Collection coll2){
return Stream.concat(coll1.stream(), coll2.stream())
.filter(coll1::contains)
.filter(coll2::contains)
.collect(Collectors.toSet());
}
public static Collection getMinus(Collection coll1, Collection coll2){
return coll1.stream().filter(not(coll2::contains)).collect(Collectors.toSet());
}
public static Predicate not(Predicate t) {
return t.negate();
}