Just to avoid concurent problems and ConcurentModificationException
in iterations over collections, you have to use concurrent collection classes.
For ArrayList
, for example, you have can try with CopyOnWriteArrayList
which is threadsafe variant of ArrayList
.
More details about this read here: http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/CopyOnWriteArrayList.html