compareTo method with Arrays.sort()