Removes from this set all of its elements that are contained in the specified collection (optional operation). If the specified collection is also a set, this operation effectively modifies this set so that its value is the
asymmetric set difference of the two sets.
This implementation determines which is the smaller of this set and the specified collection, by invoking the size
method on each. If this set has fewer elements, then the implementation iterates over this set, checking each element returned by the iterator in turn to see if it is contained in the specified collection. If it is so contained, it is removed from this set with the iterator's remove
method. If the specified collection has fewer elements, then the implementation iterates over the specified collection, removing from this set each element returned by the iterator, using this set's remove
method.
Note that this implementation will throw an UnsupportedOperationException
if the iterator returned by the iterator
method does not implement the remove
method.