title: How to pass in initialized HashMap as param?
body: <p>How can I pass in a new HashMap in the most canonical (simplest, shortest hand) form?</p>
  
  <pre><code>// 1.  ?  (of course this doesn't work)
  passMyHashMap(new HashMap&lt;String, String&gt;().put("key", "val"));
  
  // 2.   ? (of course this doesn't work)
  passMyHashMap(new HashMap&lt;String, String&gt;(){"key", "val"});
  
  
  void passMyHashMap(HashMap&lt;?, ?&gt; hm) {
      // do stuff witih my hashMap
  } 
  </code></pre>