I am getting an exception when I try to remove elements from CopyOnWriteArrayList using an iterator. I have noticed that it is documented
Element-c
Something like this:
int pos = 0; while(pos < lst.size() ) { Foo foo = lst.get(pos); if( hasToBeRemoved(foo) ) { lst.remove(pos); // do not move position } else { pos++; } }