title: Add entries to ArrayList in HashMap
body: <p>I have an ArrayList with some entries as a value in a HashMap, how to add new values to it? </p>
  
  <p>Thanks.Did it like this:</p>
  
  <pre><code>Map&lt;String, ArrayList&lt;String&gt;&gt; index = new HashMap&lt;String, ArrayList&lt;String&gt;&gt;();
  void add(String kword, String... urls){
      if(index.containsKey(kword)){
          index.get(kword).addAll(Arrays.asList(urls));
      } else {
          index.put(kword, (ArrayList&lt;String&gt;) Arrays.asList(urls));
      }
  }
  </code></pre>