Currently my code is causing intermittent ConcurrentModificationException errors, probably because of the way I am looping through the HashMap:
for (Map.Entry<String, Entity> entry : entities.entrySet()) {
    String key = entry.getKey();
    Entity item = entry.getValue();
    if (item.isDestroyed()){
        entities.remove(key);
        ViewManager.getInstance().removeItem(key);
        //INSTRUCT THE ENTITY TO PERFORM IT'S DESTROYED BEHAVIOR item.Destroyed()                    
    } else {
        item.update(1);
        ConsoleItem ci = new ConsoleItemImpl(item.getIdentifier(), item.getLocation(), ColorStringConverter.getInstance().StringToColor(item.getSide()), item.getAngle(), item.getShape(), item.toString(), item.isDestroyed(), item.isDamaged());
        ViewManager.getInstance().updateItem(ci);                    
    }
    item.update(1);
}
// updateInfo call
ViewManager.getInstance().updateInfo(summary());
}
How does one continuously loop though a HashMap and avoid a ConcurrentModificationException error?
 
     
     
     
     
    
