### Question:
CompletableResultCode { public CompletableResultCode join(long timeout, TimeUnit unit) { if (isDone()) { return this; } final CountDownLatch latch = new CountDownLatch(1); whenComplete( new Runnable() { @Override public void run() { latch.countDown(); } }); try { if (!latch.await(timeout, unit)) { fail(); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); fail(); } return this; } CompletableResultCode(); static CompletableResultCode ofSuccess(); static CompletableResultCode ofFailure(); static CompletableResultCode ofAll(final Collection<CompletableResultCode> codes); CompletableResultCode succeed(); CompletableResultCode fail(); boolean isSuccess(); CompletableResultCode whenComplete(Runnable action); boolean isDone(); CompletableResultCode join(long timeout, TimeUnit unit);  }### Answer:
@Test void join() { CompletableResultCode result = new CompletableResultCode(); new Thread( () -> { Uninterruptibles.sleepUninterruptibly(50, TimeUnit.MILLISECONDS); result.succeed(); }) .start(); assertThat(result.join(10, TimeUnit.SECONDS).isSuccess()).isTrue(); assertThat(result.join(0, TimeUnit.NANOSECONDS).isSuccess()).isTrue(); }