title: Add value to key only with condition for hashmap
body: <p>Is there any way I could add a value (or change a key's value) to a key only if a condition is met?</p>
  
  <p>I mean, something like:</p>
  
  <pre><code>myHashMap.add(key, if(true){//add this value} else {//add a different value});
  </code></pre>