intersection method

Set<E> intersection(
  1. Set<E> other
)

Returns a new set containing all elements that are contained by both this set and other.

Implementation

Set<E> intersection(Set<E> other) =>
    where((E element) => other.contains(element)).toSet();