Quick { public void quicksort(List<T> A, int p, int r) { if (p < r) { int q = partition(A, p, r); quicksort(A, p, q-1); quicksort(A, q+1, r); } } Quick();   Quick(Random generator); int partition(List<T> A, int p, int r); int randomizedPartition(List<T> A, int p, int r); void randomizedQuicksort(List<T> A, int p, int r); void quicksort(List<T> A, int p, int r);  }
@Test public void testQuicksort() { List<Integer> input = Arrays.asList(7, 3, 1, 0, 2, 9, 10, 1); List<Integer> expectedOutput = Arrays.asList(0, 1, 1, 2, 3, 7, 9, 10); tester.quicksort(input, 0, input.size() - 1); assertArrayEquals(expectedOutput.toArray(), input.toArray()); }