Groovy web console

subscribe to the feed Subscribe
to this
site
ConcurrentModificationException (via #groovywebconsole)
tweet this snippet Tweet
this
script

ConcurrentModificationException

Published 3 weeks ago by kolomiec with tags java ConcurrentModificationException
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
Map<String,String> map = new HashMap<String,String>();
    map.put("a", "a");
    map.put("b", "b");
 
    for(String key:map.keySet()) {
        map.remove(key);
    }