void (CountDownLatch latch, long ms, AtomicReference<? super String> error, String message, BooleanSupplier success) { try { if (ms > 0) Thread.sleep(ms); } catch (InterruptedException ignore) { } finally { if (!success.getAsBoolean()) error.set(message); latch.countDown(); } }