@Override
			public int compare(OverlayNode ov1, OverlayNode ov2) {
				TOCItem o1 = ov1.getTOCItemDefinition();
				TOCItem o2 = ov2.getTOCItemDefinition();

				if (!o1.getSortPreference().equals(o2.getSortPreference())) {
					return o1.getSortPreference().compareTo(o2.getSortPreference());
				}

				// if sort preference is the same, then sort alphabetically by display name
				String text1 = o1.getTextAttribute();
				String text2 = o2.getTextAttribute();

				// null values can happen for reference items
				if (text1 == null && text2 == null) {
					return 0;
				}

				// push any null values to the bottom
				if (text1 == null) {
					return 1;
				}
				else if (text2 == null) {
					return -1;
				}

				int result = text1.compareTo(text2);
				if (result != 0) {
					return result;
				}

				// At this point we have 2 nodes that have the same text attribute as children of
				// a <TOCDEF> tag.  This is OK, as we use text only for sorting, but not for the
				// display text.   Use the ID as a tie-breaker for sorting, which should provide
				// sorting consistency.
				return o1.getIDAttribute().compareTo(o2.getIDAttribute()); // ID should not be null
			}
A class that will take in a group of help directories and create a tree of
help Table of Contents (TOC) items.  Ideally, this tree can be used to create a single
TOC document, or individual TOC documents, one for each help directory (this allows
for better modularity).
<p>
We call this class an <b>overlay</b> tree to drive home the idea that each
help directory's TOC data is put into the tree, with any duplicate paths overlayed
on top of those from other help directories.
Ghidra/Framework/Help/src/main/java/help/OverlayHelpTree.java