java hashmap add while iterating code example
Example: update hashmap value while iterating
for (Map.Entry<Key, Long> entry : playerCooldowns.entrySet()) {
entry.setValue(entry.getValue() - 20);
}
for (Map.Entry<Key, Long> entry : playerCooldowns.entrySet()) {
entry.setValue(entry.getValue() - 20);
}