code: protected synchronized boolean resolve(Object... values) {
          if (isSettled()) {
              return false;
          }
          this.values = values;
          state = State.FULFILLED;
          notifyListeners();
          return true;
      }
docs: Resolves the promise. NOTE: The thread resolving the promise will be
  used to execute waiting listeners.
  @param values the result which resolves the Deferred.
  @return true if the promise is resolved; false in case the promise is
  already settled.