I executed the following code
Map<String, SyncPrimitive> syncPrimitives = new HashMap<String, SyncPrimitive>();
for (SyncPrimitive primitive : this.getSyncPrimitives()) {
String groupId = primitive.getId();
primitive.onConnect(groupId);
}
Then I' getting the following exception
Error while calling watcher
java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:793)
at java.util.HashMap$KeyIterator.next(HashMap.java:828)
In the onConnect method the primitive oject is modified. How can I overcome this issue?