FELIX-2508 Replaced TreeMap used for sorting by a Comparator implementation used together with Arrays.sort.