scala> // sortWith() scala> val data = List(1, 2, 3, 4, 5, 6) data: List[Int] = List(1, 2, 3, 4, 5, 6) scala> val res = data.sortWith(_ > _) res: List[Int] = List(6, 5, 4, 3, 2, 1)