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