code: @Override
      public ListenableFuture<Void> submitCommand(Command command) throws NotLeaderException {
          checkState(running); // implies conversion setup and initialization happened
  
          // since access to raftAlgorithm is not serialized
          // here it's possible for raftAlgorithm to be stopped
          // by one thread in the time between a caller thread
          // doing a successful check above and calling submitCommand
          // below, triggering an ISE. I judge this acceptable.
          // The alternative is serializing access to raftAlgorithm here
          // (raftAlgorithm methods themselves are serialized) and
          // holding yet another lock while calling into raftAlgorithm
  
          return raftAlgorithm.submitCommand(command);
      }
docs: {@inheritDoc}
  
  @throws IllegalStateException if this method is called when {@code RaftAgent} is not running