A ConcurrentModificationException
can be thrown in a single thread environment. It is used whenever an object is modified in a context where it shouldn't, not necessarily in another thread.
Example:
public class CME {
public static void main(String...args) {
HashSet coll = new HashSet();
coll.add(1);
coll.add(2);
coll.add(3);
for(Integer i : coll) {
coll.remove(i); // Throws ConcurrentModificationException
}
}
}