1
JavaIntermediate#java8#streams
Fail-fast (ArrayList, HashMap) throw ConcurrentModificationException if the collection is modified during iteration. Fail-safe (ConcurrentHashMap, CopyOnWriteArrayList) operate on a clone or snapshot and don't throw.
List<Integer> l = new ArrayList<>(List.of(1,2,3));
for (int x : l) { l.remove(0); } // throws ConcurrentModificationException