class CategoryComparator implements Comparator<Rule> {

    @Override
    public int compare(Rule r1, Rule r2) {
      boolean hasCat = r1.getCategory() != null && r2.getCategory() != null;
      if (hasCat) {
        int res = r1.getCategory().getName().compareTo(r2.getCategory().getName());
        if (res == 0) {
          return r1.getDescription() != null && r2.getDescription() != null ? r1.getDescription().compareToIgnoreCase(r2.getDescription()) : 0;
        }
        return res;
      }
      return r1.getDescription() != null && r2.getDescription() != null ? r1.getDescription().compareToIgnoreCase(r2.getDescription()) : 0;
    }

  }
  
  /**
   * Update display of rules tree
   */
  private void updateRulesTrees(List<Rule> rules) {<FILL_FUNCTION_BODY>

    String[] specialTabNames = config.getSpecialTabNames();
    int numConfigTrees = 2 + specialTabNames.length;
    for (int i = 0; i < numConfigTrees; i++) {
      if(i == 0) {
        rootNode[i] = createTree(rules, false, null, rootNode[i]);   //  grammar options
      } else if(i == 1) {
        rootNode[i] = createTree(rules, true, null, rootNode[i]);    //  Style options
      } else {
        rootNode[i] = createTree(rules, true, specialTabNames[i - 2], rootNode[i]);    //  Special tab options
      }
      configTree[i].setModel(getTreeModel(rootNode[i], rules));
    }
  
<no_super_class>