title: Add a Scala Map into another Scala Map
body: <p>I am trying to add a Scala Map object into another Scala Map object.</p>
  
  <p>I've found this <a href="https://stackoverflow.com/questions/6995980/map-inside-map-in-scala">post</a> but I didn't understand it. I've done some googling but no luck. </p>
  
  <p>I created a test method and need help getting it to run. </p>
  
  <p><strong>Here is Code:</strong></p>
  
  <pre><code>package com.foo.bar
  
  import collection.mutable.Map
  import org.junit.Test
  import org.junit.Assert;
  
  class FooTest {
  
    @Test
    def testMap() {
  
      val row =  Map("fooKey" -&gt; "fooValue", "barKey" -&gt; "barValue")
      var dataToPersist = collection.mutable.Map[String, collection.mutable.Map[String, String]]()
      dataToPersist("fooKey" -&gt; row)
      Assert.assertNotNull(dataToPersist("fooKey"))
      }
  }
  </code></pre>
  
  <p><strong>I get this error while running test:</strong></p>
  
  <pre><code>[ERROR] /Users/app/src/test/scala/com/foo/bar/FooTest.scala:14: error: type mismatch;
  [INFO]  found   : (String, scala.collection.mutable.Map[String,String])
  [INFO]  required: String
  [INFO]     dataToPersist("fooKey" -&gt; row)
  [INFO]                            ^
  [WARNING] one warning found
  [ERROR] one error found
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  </code></pre>
  
  <p><strong>Thanks! Here's working code:</strong></p>
  
  <pre><code>package com.foo.bar
  
  import collection.mutable.Map
  import org.junit.Test
  import org.junit.Assert;
  
  class FooTest {
  
    @Test
    def testMap() {
  
      val row =  Map("fooKey" -&gt; "fooValue", "barKey" -&gt; "barValue")
      var dataToPersist = Map[String, collection.mutable.Map[String, String]]()
  
      dataToPersist += "fooKey" -&gt; row
  
      Assert.assertNotNull(dataToPersist("fooKey"))
      }
  }
  </code></pre>