Why sameElements returned true for sets? Sets do not put elements in any order. In following two examples, the first one returns true but the second one returns false.
scala> val xs1 = Set(3, 2, 1, 4, 5, 6, 7)
xs1: scala.collection.immutable.Set[Int] = Set(5, 1, 6, 2, 7, 3, 4)
scala> val ys1 = Set(7, 2, 1, 4, 5, 6, 3)
ys1: scala.collection.immutable.Set[Int] = Set(5, 1, 6, 2, 7, 3, 4)
scala> xs1 sameElements ys1
res7: Boolean = true
scala> val xt1 = Set(1, 2, 3)
xt1: scala.collection.immutable.Set[Int] = Set(1, 2, 3)
scala> val yt1 = Set(3, 2, 1)
yt1: scala.collection.immutable.Set[Int] = Set(3, 2, 1)
scala> xt1 sameElements yt1
res8: Boolean = false