docs: private void calculateMaxLevel() {
      if (tree.getRules() == null) {
        LOG.debug("No rules set for this tree");
        return;
      }
      
      for (Integer level : tree.getRules().keySet()) {
        if (level > max_rule_level) {
          max_rule_level = level;
        }
      }
    }