void () { List<String> src = IntStreamEx.range(0, 100).mapToObj(String::valueOf).toList(); AtomicBoolean processing = new AtomicBoolean(); parallelQuery(src).forEach(__ -> { assertTrue(processing.compareAndSet(false, true)); TimeoutUtil.sleep(1); processing.set(false); return true; }); }