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