code: public R get() throws InterruptedException, ExecutionException {
          latch.await();
  
          try {
              lock.lock();
              if (isCancelled) {
                  throw new CancellationException();
              }
              else if (failure != null) {
                  throw new ExecutionException(failure);
              }
  
              return result;
          }
          finally {
              lock.unlock();
          }
      }
docs: {@inheritDoc}