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