This is not really an answer, just addition to Lee-Falcon's correct answer.
Comparator should always sort in natural ordering (which is lexicographcally for strings and asceding for numbers).
Once you have implementation and you want to change the ordering, you can simply replace
return value;
with
return -1 * value;
but I'd recommend to use reverse comparator
Integer[] ar = { 1, 3, 2, 4};
Arrays.sort(ar); // sort with natural ordering
System.out.println(Arrays.toString(ar));
Arrays.sort(ar, Collections.reverseOrder()); // sort with reverse ordering
System.out.println(Arrays.toString(ar));
Collections.reverseOrder()
accepts also comparator instance:
Arrays.sort(ar, Collections.reverseOrder(c));