Arrays.sort(numsWithIndices, (a,b) -> Integer.compare(a[1],b[1]));