title: Is it possible/required to speed up HashMap operations on same entry?
body: <p>Suppose I wish to check <code>HashMap</code> entry and then replace it:</p>
  
  <pre><code>if( check( hashMap.get(key) ) ) {
      hashMap.put(key, newValue);
  }
  </code></pre>
  
  <p>this will cause search procedure inside <code>HashMap</code> to run two times: once while <code>get</code> and another one while <code>put</code>. This looks ineffective. Is it possible to modify value of already found entry of Map?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I know I can make a wrapper and I know I have problems to mutate entry. But the question is WHY? May be <code>HashMap</code> remembers last search to improve repeated one? Why there are no methods to do such operation?</p>