code: public <T> Future<T> addTask(String title,
                                   long total,
                                   ProgressAsyncHandler<T> handler) {
          if (executor.isShutdown()) {
              throw new IllegalStateException("Adding task to closed progress manager");
          }
  
          InternalTask<T> task = new InternalTask<>(title, total, handler);
          queuedTasks.add(task);
          startTasks();
          return task;
      }
docs: Add a task to be done while showing progress. If there are too many tasks
  ongoing, the task will be queued and done when the local thread pool has
  available threads.
  
  @param title The progress title of the task.
  @param total The total progress to complete.
  @param handler The handler to do the task behind the progress being shown.
  @param <T> The return type for the task.
  @return The future returning the task result.