I have a list of objects of type A. In a first iteration I assign each object a double value 0 < x < 1 and then want to sort each object according to it\'s x value.
Use tuples instead of creating a new wrapper class.
List((1.2, "a1"), (0.1, "a2"), (0.9, "a3")).sorted // List((0.1,a2), (0.9,a3), (1.2,a1))