Java, Spring, Microservices, Interview, Coding.
ConcurrentModificationException */ public Iterator<E> iterator() { return map.keySet().iterator(); } Points to note: Unlike HashMap where hash function is calculated using key HashSet uses the value itself to calculate the hash function. Since hash function is calculated using value that is why