docs: @SuppressWarnings({ "unchecked", "rawtypes" })
    @Override
    public int compareTo(ClassLabel o) {
      HierarchicalClassLabel h = (HierarchicalClassLabel) o;
      for (int i = 0; i < this.levelwiseNames.length && i < h.levelwiseNames.length; i++) {
        int comp = 0;
        try {
          Comparable first = this.levelwiseNames[i];
          Comparable second = h.levelwiseNames[i];
          comp = first.compareTo(second);
        } catch (RuntimeException e) {
          String h1 = (String) (this.levelwiseNames[i] instanceof Integer ? this.levelwiseNames[i].toString() : this.levelwiseNames[i]);
          String h2 = (String) (h.levelwiseNames[i] instanceof Integer ? h.levelwiseNames[i].toString() : h.levelwiseNames[i]);
          comp = h1.compareTo(h2);
        }
        if (comp != 0) {
          return comp;
        }
      }
      return (this.levelwiseNames.length < h.levelwiseNames.length) ? -1 : ((this.levelwiseNames.length == h.levelwiseNames.length) ? 0 : 1);
    }