title: Why do mutable and immutable ListMaps have different orders in Scala?
body: <p>Why does the immutable version of the ListMap store in ascending order, while mutable version stores in descending order?</p>
  
  <p>Here is a test that you can use if you got scalatest-1.6.1.jar and junit-4.9.jar </p>
  
  <pre><code>  @Test def StackoverflowQuestion()
    {
      val map = Map("A" -&gt; 5, "B" -&gt; 12, "C" -&gt; 2, "D" -&gt; 9, "E" -&gt; 18)
      val sortedIMMUTABLEMap = collection.immutable.ListMap[String, Int](map.toList.sortBy[Int](_._2): _*)
      println("head : " + sortedIMMUTABLEMap.head._2)
      println("last : " + sortedIMMUTABLEMap.last._2)
      sortedIMMUTABLEMap.foreach(X =&gt; println(X))
      assert(sortedIMMUTABLEMap.head._2 &lt; sortedIMMUTABLEMap.last._2)
  
      val sortedMUTABLEMap = collection.mutable.ListMap[String, Int](map.toList.sortBy[Int](_._2): _*)
      println("head : " + sortedMUTABLEMap.head._2)
      println("last : " + sortedMUTABLEMap.last._2)
      sortedMUTABLEMap.foreach(X =&gt; println(X))
      assert(sortedMUTABLEMap.head._2 &gt; sortedMUTABLEMap.last._2)
    }
  </code></pre>
  
  <p>Heres the output of the PASSING test :</p>
  
  <pre><code>head : 2
  last : 18
  (C,2)
  (A,5)
  (D,9)
  (B,12)
  (E,18)
  head : 18
  last : 2
  (E,18)
  (B,12)
  (D,9)
  (A,5)
  (C,2)
  </code></pre>