This question is a more special case of the problem described (and solved) in this question.
I have two methods, stopAndRemove(ServerObject server) and a close() met
Perhaps this is the wrong way to do it, but I always create a removal collection, which contains indexes or references to the objects that need to be removed. I then iterate over that collection and remove those indexes/objects from the original collection. Probably not the most efficient but it got the job done.
Instead of
for(Collection things : thing)
things.remove(thing)
I use
Collection toRemove = new LinkedList();
for(things : thing)
toRemove.add(thing);
for(toRemove : thing)
things.remove(thing)