title: Nested Default Maps in Scala
body: <p>I'm trying to construct nested maps in Scala, where both the outer and inner map use the "withDefaultValue" method.  For example, the following : </p>
  
  <pre><code>val m = HashMap.empty[Int, collection.mutable.Map[Int,Int]].withDefaultValue( HashMap.empty[Int,Int].withDefaultValue(3))
  m(1)(2)
  res: Int = 3
  m(1)(2) = 5
  m(1)(2) 
  res: Int = 5
  m(2)(3) = 6
  m
  res : scala.collection.mutable.Map[Int,scala.collection.mutable.Map[Int,Int]] = Map()
  </code></pre>
  
  <p>So the map, when addressed by the appropriate keys, gives me back what I put in.  However, the map itself appears empty!  Even m.size returns 0 in this example.  Can anyone explain what's going on here?</p>