retainAll method
See Set.retainAll
Implementation
@override
void retainAll(Iterable<Object?> elements) {
List<V> chosen = <V>[];
for (final target in elements) {
if (target is V && contains(target)) {
chosen.add(target);
}
}
clear();
addAll(chosen);
}