void () { CountDownLatch waiter = new CountDownLatch(1); myQueue.queue(Update.create(waiter, () -> waiter.countDown())); ProgressIndicatorUtils.awaitWithCheckCanceled(waiter); try { myQueue.waitForAllExecuted(10, TimeUnit.SECONDS); } catch (ExecutionException | InterruptedException | TimeoutException e) { throw new RuntimeException(e); } }