QuickSortExample { static void quickSort(int[] n, int left, int right) { int dp; if (left < right) { dp = partition(n, left, right); quickSort(n, left, dp - 1); quickSort(n, dp + 1, right); } }    }
@Test public void quickSort() { int[] unSort = new int[]{2, 3, 1}; QuickSortExample.quickSort(unSort, 0, 2); StringBuilder strBuilder = new StringBuilder(); for (int i : unSort) { strBuilder.append(i).append(" "); } assertEquals("1 2 3", strBuilder.toString().trim()); }