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 ) ; }
Case insensitive comparison of labels of two tree items .