The classic example of a CME in a single thread is something like
List strs = new ArrayList();
strs.add("foo");
strs.add("bar");
for(String str : strs) {
strs.add(str + " added");
}
The CME fires because you're in the process of iterating over the list and you modify it other than via the iterator. You are allowed to modify the list via its iterator without getting a CME:
ListIterator strIt = strs.listIterator();
while(strIt.hasNext()) {
String str = strIt.next();
strIt.add(str + " added");
}
// strs now contains "foo", "foo added", "bar", "bar added"