title: Is there a Java equivalent of Python's defaultdict?
body: <p>In Python, the <code>defaultdict</code> class provides a convenient way to create a mapping from <code>key -&gt; [list of values]</code>, in the following example,</p>
  <pre class="lang-py prettyprint-override"><code>from collections import defaultdict
  d = defaultdict(list)
  d[1].append(2)
  d[1].append(3)
  # d is now {1: [2, 3]}
  </code></pre>
  <p>Is there an equivalent to this in Java?</p>