### Question:
Sort { int[] sort(int[] arr) { if (arr.length > 1) { int pivot = arr[0]; int[] less = new int[arr.length]; int[] pivotList = new int[arr.length]; int[] more = new int[arr.length]; int indexLess = 0; int indexPivot = 0; int indexMore = 0; for (int i = 0; i< arr.length; i++) { int value = arr[i]; if (value < pivot) { less[indexLess] = value; indexLess++; } if (value > pivot) { more[indexMore] = value; indexMore++; } if (value == pivot) { pivotList[indexPivot] = value; indexPivot++; } } less = sort(Arrays.copyOf(less,indexLess)); more = sort(Arrays.copyOf(more,indexMore)); int[] ret = new int[arr.length]; for (int i = 0; i < indexLess; i++) { ret[i] = less[i]; } for (int i = 0; i < indexPivot; i++) { ret[indexLess+i] = pivotList[i]; } for (int i = 0; i < indexMore; i++) { ret[indexLess+indexPivot+i] = more[i]; } return ret; } return arr; }    }### Answer:
@Test(timeout=1000) public void randomArrayTest() { for (int i = 0; i < 100; i++) { int[] random = getRandomArray(new Random().nextInt(200)+1); assertArrayEquals(sort(random), new Sort().sort(random)); } }
@Test(timeout=1000) public void sortArrayTest() { for (int i = 0; i < 50; i++) { int[] random = getSortArray(new Random().nextInt(200)+1); assertArrayEquals(random, new Sort().sort(random)); } }
@Test(timeout=1000) public void reverseArrayTest() { for (int i = 0; i < 50; i++) { int[] random = getReverseArray(new Random().nextInt(200)+1); assertArrayEquals(sort(random), new Sort().sort(random)); } }
@Test(timeout=1000) public void equalArrayTest() { for (int i = 0; i < 50; i++) { int[] random = getEqualArray(new Random().nextInt(200)+1); assertArrayEquals(sort(random), new Sort().sort(random)); } }
@Test(timeout=1000) public void emptyArrayTest() { int[] random = new int[0]; assertArrayEquals(sort(random), new Sort().sort(random)); }