I understand that HashSet is based on HashMap implementation but is used when you need unique set of elements. So why in the next code when putting
HashSet
HashMap
A key in a Map can only map to a single value. So the second time you put in to the map with the same key, it overwrites the first entry.
Map
put