@Override
  public boolean runCheckCanceledHooks(@Nullable ProgressIndicator indicator) {
    if (!hasCheckCanceledHooks()) {
      return false;
    }

    boolean result = myRunSleepHook && sleepIfNeededToGivePriorityToAnotherThread();
    if (myHooks.isEmpty()) {
      return result;
    }

    boolean[] resultAsArr = {result};
    myHooks.forEach(hook -> {
      if (hook.runHook(indicator)) {
        resultAsArr[0] = true; // but still continue to other hooks
      }
    });
    return resultAsArr[0];
  }
@Override
  public boolean runCheckCanceledHooks(@Nullable ProgressIndicator indicator)