title: How to combine all the values with the same key in Scala?
body: <p>I have a map like :</p>
  
  <pre><code>val programming = Map(("functional", 1) -&gt; "scala", ("functional", 2) -&gt; "perl", ("orientedObject", 1) -&gt; "java", ("orientedObject", 2) -&gt; "C++")
  </code></pre>
  
  <p>with the same first element of key appearing multiple times.</p>
  
  <p>How to regroup all the values corresponding to the same first element of key ? Which would turn this map into : </p>
  
  <pre><code>Map("functional" -&gt; List("scala","perl"), "orientedObject" -&gt; List("java","C++"))
  </code></pre>