intersect method

Set<T> intersect(
  1. Iterable<T> other
)

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

Implementation

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