title: How to update a map in a single line with compute
body: <p>For a <code>HashMap&lt;String, LongAdder&gt; named counts</code>, how may I increment its value regardless of the key being present or not?</p>
  
  <p>I've tried this</p>
  
  <pre><code>counts.compute(id, (k, v) -&gt; v == null ? new LongAdder() : v.increment());
  </code></pre>
  
  <p>However <code>v.increment()</code> is a <code>void</code> method therefore that lambda does not agree with the <code>BiFunction&lt;? super String, ? super LongAdder, ? extends LongAdder&gt;</code> contract.</p>