Java, Spring, Microservices, Interview, Coding.
only unique values are stored in the HashSet. HashSet internally uses HashMap to store its elements. When element is added to HashSet using add(E e) method internally HashSet calls put() method of the HashMap where the value passed in the add method becomes key in the put() method. A dummy value