title: Convert String list into Map[String, List]
body: <p>I'm trying to convert <code>List("a,1" , "b,2" , "c,3" , "a,2" , "b,4")</code> to type <code>scala.collection.immutable.HashMap[String, java.util.List[String]]</code> with values :</p>
  
  <pre><code>a -&gt; 1,2
  b -&gt; 2,4
  c -&gt; 3
  </code></pre>
  
  <p>So each key contains a List of its values.</p>
  
  <p>Here is my code so far : </p>
  
  <pre><code>object ConvertList extends Application {
  
    var details = new scala.collection.immutable.HashMap[String, java.util.List[String]]
  
    val strList = List("a,1" , "b,2" , "c,3" , "a,2" , "b,4")
  
    //Get all values
    val getValue : Function1[String, String] = { a =&gt; a.split(",")(1) }
    val allValues : List[String] = strList map getValue
  
    //get unique values
    val uniqueValues = allValues.toSet[String]
  
    //Somehow map each unique value to a value in the original List....
    println(uniqueValues)
  
    println(strList.flatten)
    //userDetails += "1" -&gt; List("a","b",
  
  
  }
  </code></pre>
  
  <p>How can this conversion be performed ?</p>