intersect method
Returns a union-like set combining this iterable and other.
Matches the historical behaviour from dart_helper_utils where the method
name was intersect but it effectively merged the elements.
Implementation
Set<E> intersect(Iterable<dynamic> other, {ElementConverter<E>? converter}) {
final base = toMutableSet(converter: converter);
final otherSet = ConvertObjectImpl.toSet<E>(
other,
elementConverter: converter,
debugInfo: {'method': 'IterableConversionX.intersect'},
);
base.addAll(otherSet);
return base;
}