title: Is using java Map.containsKey() redundant when using map.get()
body: <p>I have been wondering for some time whether it is allowable within best practice to refrain from using the <code>containsKey()</code> method on <code>java.util.Map</code> and instead do a null check on the result from <code>get()</code>. </p>
  
  <p>My rationale is that it seems redundant to do the lookup of the value twice - first for the <code>containsKey()</code> and then again for <code>get()</code>.</p>
  
  <p>On the other hand it may be that most standard implementations of <code>Map</code> cache the last lookup or that the compiler can otherwise do away with the redundancy, and that for readability of the code it is preferable to maintain the <code>containsKey()</code> part.</p>
  
  <p>I would much appreciate your comments.</p>