HashSet implements Hashmap internally to store the data. The data passed to HashSet is stored as key in Hashmap with null as value.