title: Odd behavior of mutable.ListMap
body: <p>I am trying to filter a <code>ListMap</code> with values in a <code>List</code>. But the order is not maintained in output <code>mutable.ListMap</code>. This is a simplified code. As there are constraints and validation checks to be done, I cant do this with <code>filter</code>.</p>
  
  <p>Here is my code,</p>
  
  <pre><code>val inMap = scala.collection.immutable.ListMap((1,5),(2,4),(3,5),(7,6))
  val alist= List(1,2,3)
  val mutableTempMap = scala.collection.mutable.ListMap.empty[Int, Int]
  
  for (jkey &lt;- alist) {
    inMap.get(jkey) match {
      case Some(y) =&gt; mutableTempMap(jkey) = y
      case None    =&gt;
    }
  }
  
  mutableTempMap
  </code></pre>
  
  <p><strong>Output:</strong></p>
  
  <pre><code>scala.collection.mutable.ListMap[Int,Int] = Map(3 -&gt; 5, 1 -&gt; 5, 2 -&gt; 4)
  </code></pre>
  
  <p><strong>Expected Output</strong></p>
  
  <pre><code>scala.collection.mutable.ListMap[Int,Int] = Map(1 -&gt; 5, 2 -&gt; 4, 3 -&gt; 5)
  </code></pre>