static bool containsAny(Collection a, Collection b) { if (empty(a)) false; Set set = asSet(b); for (A x : a) if (contains(set, x)) true; false; }