I am using a Collection (a HashMap used indirectly by the JPA, it so happens), but apparently randomly the code throws a ConcurrentModificati
Collection
HashMap
ConcurrentModificati
In Java 8, you can use lambda expression:
map.keySet().removeIf(key -> key condition);