void (Invoker invoker) { CountDownLatch latch = new CountDownLatch(1); test(invoker, latch, error -> { AtomicBoolean current = new AtomicBoolean(true); register(invoker.invoke(() -> countDown(latch, 100, error, "task is done before subtask", current::get))); current.set(false); }); }