code: public <T> CompletableFuture<T> submit(Operation<T> operation) {
      if (operation instanceof Query) {
        return submit((Query<T>) operation);
      } else if (operation instanceof Command) {
        return submit((Command<T>) operation);
      } else {
        throw new UnsupportedOperationException("unknown operation type: " + operation.getClass());
      }
    }
docs: Submits an operation to the session.
  
  @param operation The operation to submit.
  @param <T> The operation result type.
  @return A completable future to be completed with the operation result.