private boolean isAlreadySelected(TreePath path, ID id) {
			if (path == null) {
				return false;
			}

			Object pathComponent = path.getLastPathComponent();
			if (!(pathComponent instanceof DefaultMutableTreeNode)) {
				return false;
			}

			DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) pathComponent;
			TOCItem item = (TOCItem) treeNode.getUserObject();
			if (item == null) {
				return false;
			}

			ID selectedID = item.getID();
			return selectedID != null && selectedID.equals(id);
		}
Our hook to install our custom cell renderer.
Ghidra/Framework/Help/src/main/java/help/CustomTOCView.java