title: Add element(s) while creation into ArrayList
body: <p>I have a HashMap</p>
  
  <pre><code>myMap = new HashMap&lt;String, ArrayList&lt;String&gt; &gt;();
  </code></pre>
  
  <p>I am writing a code where I want to add items in <code>ArrayList</code> for the key if it exists in the map, </p>
  
  <pre><code>myMap.get(key).add(element);
  </code></pre>
  
  <p>or else create a new <code>ArrayList</code>, add an item to the list, and add this list to the map.</p>
  
  <pre><code>ArrayList&lt;String&gt; tmpArrList = new ArrayList&lt;&gt;();
  tmpArrList.add(element);
  myMap.put(key, tmpArrayList);
  </code></pre>
  
  <p>Writing three lines for adding single element, do not look good to me, <strong>how can I</strong> <strong>write it in single line using Java 5</strong>.. ?</p>