code: public void releaseExceptionally(Throwable e) {
          ArrayList<CompletableFuture<T>> toComplete = null;
          synchronized (lock) {
              if (!waitingFutures.isEmpty()) {
                  toComplete = new ArrayList<>(waitingFutures);
                  waitingFutures.clear();
              }
              this.e = e;
              this.result = null;
              released = true;
          }
          if (toComplete != null) {
              for (CompletableFuture<T> f : toComplete) {
                  f.completeExceptionally(e);
              }
          }
      }
docs: Complete all waiting futures, and all future calls to register be notified immediately. If release is
  called twice consecutively the second value will be the one passed to future callers of
  {@link #register(CompletableFuture)}
  
  @param e The exception to pass to waiting futures.