[java] How to sort an array of ints using a custom comparator?