code: @CheckForNull
      public Object[] getValues(long timeout) throws InterruptedException {
          if (!isSettled()) {
              synchronized (this) {
                  wait(timeout);
              }
          }
          if (values == null) {
              return null;
          }
          return Arrays.copyOf(values, values.length);
      }
docs: Get the resolved values of the promise. If the promise is not settled,
  the call blocks until the promise is settled or timeout is reached.
  
  @param timeout the maximum time to wait in milliseconds.
  @return the resolved values or null in case of timeout.
  @throws InterruptedException if the thread is interrupted.