java8 map how to add some element to a list value simply
<p>I want to use <code>Map&lt;String, List&lt;String&gt;&gt;</code> to record something, e.g.
each city have how many users of some kind .</p>

<p>Now my code is </p>

<pre><code>    Map&lt;String, List&lt;String&gt;&gt; map = new HashMap&lt;&gt;();
    if(map.get("city_1")==null){
        map.put("city_1", new ArrayList&lt;&gt;());
    }
    map.get("city_1").add("aaa");
</code></pre>

<p>but I feel it's a little cumbersome, I want this effect</p>

<pre><code>    Map&lt;String, List&lt;String&gt;&gt; map = new HashMap&lt;&gt;();
    map.compute("city_1", (k,v)-&gt;v==null?new ArrayList&lt;&gt;():v.add("aaa"));
</code></pre>

<p>but it has compile error:</p>

<pre><code>Type mismatch: cannot convert from boolean to List&lt;String&gt;
</code></pre>

<p>So have any other manner could simplify it?</p>