Java, Spring, Microservices, Interview, Coding.
added to the HashSet) becomes the key and a dummy value “PRESENT” is added as value when storing it in the backing HashMap. One thing to note here is, in HashMap value may be duplicate but Key should be unique. That’s how HashSet makes sure that only unique values are stored in it, since the value