Wouldn’t Collections.disjoint(A, B) work? From the documentation:
Returns
trueif the two specified collections have no elements in common.
Thus, the method returns false if the collections contains any common elements.
Wouldn’t Collections.disjoint(A, B) work? From the documentation:
Returns
trueif the two specified collections have no elements in common.
Thus, the method returns false if the collections contains any common elements.