void (Invoker invoker) { AtomicInteger value = new AtomicInteger(10); CountDownLatch latch = new CountDownLatch(1); test(invoker, latch, error -> { if (0 < value.decrementAndGet()) throw new ProcessCanceledException(); latch.countDown(); }); }