Changing HashMap keys during iteration

Maybe this helps:

map.put(newkey,map.remove(oldkey));

Leave a Comment