import java.util.Arrays; import java.util.Random; public class MergeTest { public static void main(String[] args) { final int NUM_THREADS = 4; // Change this to however many threads you want to test with testRandom(NUM_THREADS); System.out.println("Congrats! Your implementation passes the randomly generated test cases!"); } /** * Generates and tests PMerge 10 times with random array inputs. * @param numThreads number of threads to run PMerge with */ public static void testRandom(int numThreads) { Random rand = new Random(); for(int i = 0; i<10; ++i) { int aSize = rand.nextInt(200); int bSize = rand.nextInt(200); int[] a = new int[aSize], b = new int[bSize]; for(int j = 0; j