title: How to implement Map with default operation in Scala
body: <pre><code>class DefaultListMap[A, B &lt;: List[B]] extends HashMap[A, B] {
      override def default(key: A) = List[B]() 
    }
  </code></pre>
  
  <p>I wan't to create map <code>A -&gt; List[B]</code>. In my case it is <code>Long -&gt; List[String]</code> but when I get key from map that doesn't have value I would like to create empty <code>List</code> instead of <code>Exception</code> being thrown. I tried different combinations but I don't know how to make code above pass the compiler.</p>
  
  <p>Thanks in advance.</p>