@Test public void awaitTimeoutExceeded() throws InterruptedException { final boolean result = countDownLatch.await(100, TimeUnit.MILLISECONDS); assertThat(result).isFalse(); }
@Override public void await() throws InterruptedException { super.await(); if (isCancelled) { throw Optional.ofNullable(exception).orElse(new CountDownLatchCancelledException()); } }
CancellableCountDownLatch extends CountDownLatch { @Override public void await() throws InterruptedException { super.await(); if (isCancelled) { throw Optional.ofNullable(exception).orElse(new CountDownLatchCancelledException()); } } }
CancellableCountDownLatch extends CountDownLatch { @Override public void await() throws InterruptedException { super.await(); if (isCancelled) { throw Optional.ofNullable(exception).orElse(new CountDownLatchCancelledException()); } } CancellableCountDownLatch(int count); }
CancellableCountDownLatch extends CountDownLatch { @Override public void await() throws InterruptedException { super.await(); if (isCancelled) { throw Optional.ofNullable(exception).orElse(new CountDownLatchCancelledException()); } } CancellableCountDownLatch(int count); void cancelWithException(RuntimeException ex); @Override void await(); @Override boolean await(long timeout, TimeUnit unit); }
CancellableCountDownLatch extends CountDownLatch { @Override public void await() throws InterruptedException { super.await(); if (isCancelled) { throw Optional.ofNullable(exception).orElse(new CountDownLatchCancelledException()); } } CancellableCountDownLatch(int count); void cancelWithException(RuntimeException ex); @Override void await(); @Override boolean await(long timeout, TimeUnit unit);  }