code: public void setCategorySortingComparator(Comparator comp) {
          Comparator old = categorySortingComparator;
          categorySortingComparator = comp;
          if (categorySortingComparator != old) {
              buildModel();
          }
      }
docs: Set the comparator used for sorting categories. If this changes the
  comparator, the model will be rebuilt.
  
  @param comp