public final void sort(long startIndex, long length) {
        quickSort(startIndex, length - 1);
    }
@Test
    public void testQuickSortInt() {
        final int[] array = intArrayWithRandomElements();
        final long baseAddr = memMgr.getAllocator().allocate(ARRAY_LENGTH * INT_SIZE_IN_BYTES);
        final MemoryAccessor mem = memMgr.getAccessor();
        for (int i = 0; i < ARRAY_LENGTH; i++) {
            mem.putInt(baseAddr + INT_SIZE_IN_BYTES * i, array[i]);
        }
        Arrays.sort(array);
        new IntMemArrayQuickSorter(mem, baseAddr).sort(0, ARRAY_LENGTH);
        for (int i = 0; i < ARRAY_LENGTH; i++) {
            assertEquals("Mismatch at " + i, array[i], mem.getInt(baseAddr + INT_SIZE_IN_BYTES * i));
        }
    }