public @Nullable MergingTaskQueue.QueuedTask<T> extractNextTask() {
    List<Disposable> disposeQueue = new ArrayList<>(1);

    try {
      synchronized (myLock) {
        while (true) {
          if (myTasksQueue.isEmpty()) return null;

          T task = myTasksQueue.remove(0);

          ProgressIndicatorBase indicator = myProgresses.get(task);
          //a disposed task is just ignored here
          if (indicator == null || indicator.isCanceled()) {
            disposeQueue.add(task);
            continue;
          }
          var childContext = myThreadContexts.get(task);
          return wrapTask(task, indicator, childContext);
        }
      }
    }
    finally {
      disposeSafe(disposeQueue);
    }
  }
public @Nullable MergingTaskQueue.QueuedTask<T> extractNextTask()