Basically, Set is just a card that contains only keys. Therefore, you should inform yourself about cartographic algorithms. Note. For example, a HashSet is actually just an adapter for a HashMap. The add-method HashSet just uses HashMap.put (value, SomeDummyValue).
source share