I have a groovy list of lists i.e.
list = [[2, 0, 1], [1, 5, 2], [1, 0, 3]]
I would like sort it by order of the first element, then second, th
Here's what I came up with, not the most groovy way I suppose..
list = list.sort{ a,b -> if(a[0].compareTo(b[0]) == 0) { if(a[1].compareTo(b[1]) == 0) { return a[2].compareTo(b[2]); } else { return a[1].compareTo(b[1]); } } else { return a[0].compareTo(b[0]); } }