How to avoid “ConcurrentModificationException” while removing elements from `ArrayList` while iterating it? [duplicate] Tags: arraylistiteratorjavalist