docs: public void addFinalTaskInfoListener(StateChangeListener<TaskInfo> stateChangeListener)
      {
          AtomicBoolean done = new AtomicBoolean();
          StateChangeListener<Optional<TaskInfo>> fireOnceStateChangeListener = finalTaskInfo -> {
              if (finalTaskInfo.isPresent() && done.compareAndSet(false, true)) {
                  stateChangeListener.stateChanged(finalTaskInfo.get());
              }
          };
          finalTaskInfo.addStateChangeListener(fireOnceStateChangeListener);
          fireOnceStateChangeListener.stateChanged(finalTaskInfo.get());
      }