title: Scala Map conversion
body: <p>I'm a Scala newbie I'm afraid:
  I'm trying to convert a Map to a new Map based on some simple logic: </p>
  
  <pre><code>val postVals = Map("test" -&gt; "testing1", "test2" -&gt; "testing2", "test3" -&gt; "testing3")
  </code></pre>
  
  <p>I want to test for value "testing1" and change the value (while creating a new Map)</p>
  
  <pre><code>def modMap(postVals: Map[String, String]): Map[String, String] = {
    postVals foreach {case(k, v) =&gt; if(v=="testing1") postVals.update(k, "new value")}
  }
  </code></pre>