Skip to content

Instantly share code, notes, and snippets.

@mjedynak
Created February 9, 2012 21:52
// bad solution
public void addEntryIfKeyDoesNotExist(String key, Integer value) {
if (!map.containsKey(key)) {
map.put(key, value);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment