void (Invoker invoker, CountDownLatch latch, Consumer<? super AtomicReference<String>> consumer) { Assert.assertFalse("EDT should not be used to start this test", invoker instanceof Invoker.EDT && isEventDispatchThread()); AtomicReference<String> error = new AtomicReference<>(); register(invoker.invokeLater(() -> consumer.accept(error))); String message; try { latch.await(10, TimeUnit.SECONDS); message = error.get(); } catch (InterruptedException ignore) { message = "interrupted exception"; } if (message != null) Assert.fail(message + " @ " + invoker); }