package test; import static org.junit.Assert.*; import java.lang.reflect.Array; import java.util.Arrays; import java.util.Random; import org.junit.Test; public class JUnitTest { @Test public void test() { int size = 1000; //initialize an array to test //populate with pseudo-random elements //Integer[] myArray = new Integer[size]; int[] myArray = new int[size]; Random rand = new Random(); for(int i = 0; i < size; i++) myArray[i] = rand.nextInt(3*size) + 1; //copy the array over and sort them using Arrays.sort //Integer[] expectedArray = myArray.clone(); int[] expectedArray = myArray.clone(); Arrays.sort(expectedArray); //using your sort YOUR_SORT_GOES_HERE(myArray); //assertion failure assertArrayEquals(expectedArray, myArray); } }