public static <T> Set<T> interceptionOf(Collection<? extends T> col1, Collection<? extends T> col2, Collection<? extends T> col3, Collection<? extends T>... otherCols) { Set<T> interception = C.newSet(col1); interception.retainAll(col2); interception.retainAll(col3); for (Collection<? extends T> col : otherCols) { interception.retainAll(col); } return C.set(interception); }
@Override public C.Set<T> withIn(Collection<? extends T> col) { C.Set<T> others = C.newSet(col); others.retainAll(this); if (isImmutable()) { return ImmutableSet.of(others); } return others; }
@Override public C.Set<T> withIn(Collection<? extends T> col) { C.Set<T> others = C.newSet(col); others.retainAll(this); if (isImmutable()) { return ImmutableSet.of(others); } return others; }
public static <T> Set<T> interceptionOf(Collection<? extends T> col1, Collection<? extends T> col2, Collection<? extends T> col3, Collection<? extends T>... otherCols) { Set<T> interception = C.newSet(col1); interception.retainAll(col2); interception.retainAll(col3); for (Collection<? extends T> col : otherCols) { interception.retainAll(col); } return C.set(interception); }