code: private static int compare(Treenode item1, Treenode item2) {
          String label1 = item1.getLabel();
          String label2 = item2.getLabel();
          return label1 == label2 ? 0 : label1 == null ? -1 : label2 == null ? -1 : label1.compareToIgnoreCase(label2);
      }
docs: Case insensitive comparison of labels of two tree items.
  
  @param item1 First tree item.
  @param item2 Second tree item.
  @return Result of the comparison.