code: public Map<CategoryId, Category> getCategories() {
      Map<CategoryId, Category> map = new HashMap<>();
      for (Rule rule : getAllRules()) {
        map.put(rule.getCategory().getId(), rule.getCategory());
      }
      return map;
    }
docs: Get all rule categories for the current language.
  
  @return a map of {@link Category Categories}, keyed by their {@link CategoryId id}.
  @since 3.5