Is there a “groovy” way to sort a collection by a first parameter, and if the first parameter repeats in two or more elements sort it by a second parameter (the second parameter being an array) ?
Example:
edited (Lenght of the sub array is variable):
[1, [1,2,3]]
[1, [4,6]]
[2, [1,2,3,4,5]]
[3, [1,2,3]]
[3, [1,2,4,5]]
Thanks in advance
You can use the .sort if you want to build up a custom sort:
I didn’t really deal well with the case that the lists are different lengths you could improve on that for your apps needs.