public static void sort(short[] array, ShortComparator comparator) {
        sort(array, 0, array.length, comparator);
    }
@Test
    void sorting_random_arrays_should_produce_identical_result_as_java_sort() {
        Random r = new Random(4234);
        for (int i = 0; i < 10000; i++) {
            short[] original = makeRandomArray(r);
            short[] javaSorted = Arrays.copyOf(original, original.length);
            short[] customSorted = Arrays.copyOf(original, original.length);
            PrimitiveArraySorter.sort(customSorted, Short::compare);
            Arrays.sort(javaSorted);
            String errorMsg = String.format("%s != %s (before sorting: %s)", Arrays.toString(customSorted), Arrays.toString(javaSorted), Arrays.toString(original));
            assertArrayEquals(customSorted, javaSorted, errorMsg);
        }
    }