I'm not a huge fan of checking for null values when what you actually want to check is whether the key exists -- I prefer to catch errors early. containsKey is more precise and only a couple of characters longer.