Greenhouse Controller: iterate a copy, remove from the original
Greenhouse Controller: iterate a copy, remove from the original
Answer
for (Event e : new ArrayList<Event>(eventList)) if (e.ready()) { e.action(); eventList.remove(e); }
The for-each walks a fresh copy of eventList that is never modified, so no iterator over eventList is active; eventList.remove(e) safely shrinks the original. This is the project's exact CME-avoidance pattern.