@Nullable
      Promise<? extends T> setDone() {
        Promise<? extends T> res = getResult();
        if (res == null) {
          setDone(null);
          return null;
        }
        if (res.getState() == Promise.State.PENDING) {
          return res.onSuccess(r -> setDone(r));
        }
        try {
          setDone(res.blockingGet(0));
        }
        catch (ExecutionException e) {
          ExceptionUtil.rethrow(e.getCause());
        }
        catch (TimeoutException e) {
          ExceptionUtil.rethrow(e);
        }

        return null;
      }
@Nullable
      Promise<? extends T> setDone()