public void checkIntegrity() {
		// Before we visit, integrity check that cache. Visiting will affect cache.
		for (Entry<Long, Collection<DR>> ent : cachedDataChildren.entrySet()) {
			Set<DR> databasedChildren = new TreeSet<>(Comparator.comparing(DR::getKey));
			// NOTE: Bypass the cache by using the variant with a key parameter
			databasedChildren.addAll(getDataChildrenOf(ent.getKey()));
			Set<DR> cachedChildren = new TreeSet<>(Comparator.comparing(DR::getKey));
			cachedChildren.addAll(ent.getValue());
			if (!databasedChildren.equals(cachedChildren)) {
				throw new AssertionError("Cached children of node " + ent.getKey() +
					" out of sync: cache=" + cachedChildren + " db=" + databasedChildren);
			}
		}
		for (Entry<Long, Collection<NR>> ent : cachedNodeChildren.entrySet()) {
			Set<NR> databasedChildren = new TreeSet<>(Comparator.comparing(NR::getKey));
			// NOTE: Bypass the cache by using the variant with a key parameter
			databasedChildren.addAll(getNodeChildrenOf(ent.getKey()));
			Set<NR> cachedChildren = new TreeSet<>(Comparator.comparing(NR::getKey));
			cachedChildren.addAll(ent.getValue());
			if (!databasedChildren.equals(cachedChildren)) {
				throw new AssertionError("Cached children of node " + ent.getKey() +
					" out of sync: cache=" + cachedChildren + " db=" + databasedChildren);
			}
		}
		visit(null, new TreeRecordVisitor() {
			@Override
			protected VisitResult beginNode(NR parent, NR n, QueryInclusion inclusion) {
				checkNodeIntegrity(n);
				return VisitResult.DESCEND;
			}

			@Override
			protected VisitResult visitData(NR parent, DR d, boolean included) {
				checkDataIntegrity(d);
				return VisitResult.NEXT;
			}
		}, false);
		if (leafLevel != computeLeafLevel()) {
			throw new AssertionError("Leaf level is incorrect");
		}
	}
An integrity checker for use by tree developers and testers.

<p>
To incorporate additional checks, please prefer to override
{@link #checkNodeIntegrity(DBTreeNodeRecord)} and/or
{@link #checkDataIntegrity(DBTreeDataRecord)} instead of this method.
Ghidra/Debug/ProposedUtils/src/main/java/ghidra/util/database/spatial/AbstractConstraintsTree.java