code: public List<Rule> getAllRules() {
      List<Rule> rules = new ArrayList<>();
      rules.addAll(builtinRules);
      rules.addAll(userRules);
      return rules;
    }
docs: Get all rules for the current language that are built-in or that have been
  added using {@link #addRule(Rule)}. Please note that XML rules that are grouped
  will appear as multiple rules with the same id. To tell them apart, check if
  they are of type {@code AbstractPatternRule}, cast them to that type and call
  their {@link AbstractPatternRule#getSubId()} method.
  @return a List of {@link Rule} objects