@Test public void test_sorting_custom_comparator() { short[] array = {4, 2, 5}; PrimitiveArraySorter.sort(array, (a, b) -> Short.compare(b, a)); short[] expected = {5, 4, 2}; assertArrayEquals(expected, array); }
public static void sort(short[] array, ShortComparator comparator) { sort(array, 0, array.length, comparator); }
PrimitiveArraySorter { public static void sort(short[] array, ShortComparator comparator) { sort(array, 0, array.length, comparator); } }
PrimitiveArraySorter { public static void sort(short[] array, ShortComparator comparator) { sort(array, 0, array.length, comparator); } private  PrimitiveArraySorter(); }
PrimitiveArraySorter { public static void sort(short[] array, ShortComparator comparator) { sort(array, 0, array.length, comparator); } private  PrimitiveArraySorter(); static void sort(short[] array, ShortComparator comparator); static void sort(short[] array, int fromIndex, int toIndex, ShortComparator comparator); static boolean sortAndMerge(short[] array, short[] mergeArray, int pivotIndex, int toIndex, ShortComparator comparator); static void merge(short[] array, short[] mergeArray, int pivotIndex, ShortComparator comparator); static void merge(short[] array, short[] mergeArray, int pivotIndex, int toIndex, ShortComparator comparator); }
PrimitiveArraySorter { public static void sort(short[] array, ShortComparator comparator) { sort(array, 0, array.length, comparator); } private  PrimitiveArraySorter(); static void sort(short[] array, ShortComparator comparator); static void sort(short[] array, int fromIndex, int toIndex, ShortComparator comparator); static boolean sortAndMerge(short[] array, short[] mergeArray, int pivotIndex, int toIndex, ShortComparator comparator); static void merge(short[] array, short[] mergeArray, int pivotIndex, ShortComparator comparator); static void merge(short[] array, short[] mergeArray, int pivotIndex, int toIndex, ShortComparator comparator);  }