Avoiding ConcurrentModificationException in Java

Have you ever encountered a cryptic ConcurrentModificationException in your Java code? This exception can be a real head-scratcher…