I wanted to not make a copy of the set in the removeAllNumbersGreaterThan10 and do the method on the same set given to it. but it returns these errors: Exception in thread "main" java.util.ConcurrentModificationException at java.base/java.util.HashMap$HashIterator.nextNode(HashMap.java:1584) at java.base/java.util.HashMap$KeyIterator.next(HashMap.java:1607) at com.codegym.justCoding.Main.removeAllNumbersGreaterThan10(Main.java:16) at com.codegym.justCoding.Main.createSet(Main.java:12) at com.codegym.justCoding.Main.main(Main.java:24)