package com.learning.ads.sort.quick;

import static org.junit.Assert.assertArrayEquals;

import java.util.Arrays;

import org.junit.Test;

public class QuickSortTest {

	@Test
	public void sortAscending() {
		Partition<Integer> p = new LomutoPartition<>();
		QuickSort<Integer, Partition<Integer>> sort = new QuickSort<>(p);
		Integer[] array = { 2, 8, 7, 1, 3, 5, 6, 4 };
		sort.sort(array);
		assertArrayEquals(new Integer[] { 1, 2, 3, 4, 5, 6, 7, 8 }, array);
	}

	@Test
	public void sortDescending() {
		Partition<Integer> p = new LomutoPartition<>();
		QuickSort<Integer, Partition<Integer>> sort = new QuickSort<>(p);
		Integer[] array = { 2, 8, 7, 1, 3, 5, 6, 4 };
		sort.sortDescending(array);
		System.out.println(Arrays.toString(array));
		assertArrayEquals(new Integer[] { 8, 7, 6, 5, 4, 3, 2, 1 }, array);
	}

}

@@ -86,34 +86,8 @@
 s;%0A%0A
-import java.util.Arrays;%0A%0A
 impo
@@ -673,54 +673,8 @@
 y);%0A
-%09%09System.out.println(Arrays.toString(array));%0A
 %09%09as

Removing un-necessary print statement