Generalized from HashSet to Set

So the methods are not restricted to acting on just HashSets, e.x. a
tree set may be used in the future