copy method

Iterable<T> copy()

Copies this Iterable preserving the original type if possible or returns a copy as List.

Implementation

Iterable<T> copy() {
  var self = this;
  if (self is Set<T>) {
    return self.toSet();
  } else {
    return self.toList();
  }
}