ConcurrentModificationException in unmodifiable collection [duplicate]
问题 This question already has answers here : Why is a ConcurrentModificationException thrown and how to debug it (7 answers) Closed 10 months ago . I have this code below, and I'm getting a ConcurrentModificationException by executing the following line: filterCardsToDevice(getCollection()); the code: private List<MyClass> filterCardsToDevice(Collection<MyClass> col) { final List<MyClass> newList = new ArrayList<MyClass>(); for (MyClass myObj : col) { long id = myObj.getId(); if (id < 0 || id >