### Question:
ExecUtils { public static void doInParallel(int numTasks, Consumer<Integer> task) { doInParallel(numTasks, numTasks, false, task); } private  ExecUtils(); static void doInParallel(int numTasks, Consumer<Integer> task); static void doInParallel(int numTasks,
                                  int parallelism,
                                  boolean privatePool,
                                  Consumer<Integer> task); static R collectInParallel(int numTasks,
                                          int parallelism,
                                          boolean privatePool,
                                          Function<Integer,T> task,
                                          Collector<? super T,?,R> collector);  }### Answer:
@Test public void testDoInParallel() { assertEquals(1, maxActive(1, 1, false)); assertEquals(1, maxActive(1, 1, true)); assertEquals(1, maxActive(4, 1, false)); assertEquals(1, maxActive(4, 1, true)); int cores = Runtime.getRuntime().availableProcessors(); assertEquals(Math.min(cores, 4), maxActive(4, 4, false)); assertEquals(4, maxActive(4, 4, true)); }