void () { int cores = Runtime.getRuntime().availableProcessors(); assertTrue(cores > 1); int eachSleep = 200; long start = System.currentTimeMillis(); parallelQuery(Arrays.asList("a", "b")).allowParallelProcessing().forEach(__ -> { TimeoutUtil.sleep(eachSleep); return true; }); long elapsed = System.currentTimeMillis() - start; assertTrue("elapsed " + elapsed + " on " + cores + " cores", elapsed < eachSleep * 2); }