intersect method

Set<T> intersect(
  1. Iterable other
)

Returns a set containing all elements that are contained by both this set and the specified collection.

Implementation

Set<T> intersect(Iterable other) {
  final set = this.toSet();
  set.retainAll(other);
  return set;
}