code: public <T> CompletableFuture<T> submit(Command<T> command) {
      State state = state();
      if (state == State.CLOSED || state == State.EXPIRED) {
        return Futures.exceptionalFuture(new ClosedSessionException("session closed"));
      }
      return submitter.submit(command);
    }
docs: Submits a command to the session.
  
  @param command The command to submit.
  @param <T> The command result type.
  @return A completable future to be completed with the command result.