@Test public void testOrderedMergeSort() { int[] order = IndirectSort.mergesort(0, DATA_LENGTH, Integer::compare); assertOrder(order, DATA_LENGTH, Integer::compare); }
public static int[] mergesort(int start, int length, IntBinaryOperator comparator) { final int[] src = createOrderArray(start, length); if (length > 1) { final int[] dst = (int[]) src.clone(); topDownMergeSort(src, dst, 0, length, comparator); return dst; } return src; }
IndirectSort { public static int[] mergesort(int start, int length, IntBinaryOperator comparator) { final int[] src = createOrderArray(start, length); if (length > 1) { final int[] dst = (int[]) src.clone(); topDownMergeSort(src, dst, 0, length, comparator); return dst; } return src; } }
IndirectSort { public static int[] mergesort(int start, int length, IntBinaryOperator comparator) { final int[] src = createOrderArray(start, length); if (length > 1) { final int[] dst = (int[]) src.clone(); topDownMergeSort(src, dst, 0, length, comparator); return dst; } return src; } private  IndirectSort(); }
IndirectSort { public static int[] mergesort(int start, int length, IntBinaryOperator comparator) { final int[] src = createOrderArray(start, length); if (length > 1) { final int[] dst = (int[]) src.clone(); topDownMergeSort(src, dst, 0, length, comparator); return dst; } return src; } private  IndirectSort(); static int[] mergesort(int start, int length, IntBinaryOperator comparator); static int[] mergesort(
      T[] input, int start, int length, Comparator<? super T> comparator); }
IndirectSort { public static int[] mergesort(int start, int length, IntBinaryOperator comparator) { final int[] src = createOrderArray(start, length); if (length > 1) { final int[] dst = (int[]) src.clone(); topDownMergeSort(src, dst, 0, length, comparator); return dst; } return src; } private  IndirectSort(); static int[] mergesort(int start, int length, IntBinaryOperator comparator); static int[] mergesort(
      T[] input, int start, int length, Comparator<? super T> comparator);  }