private void checkOrderSatisfiesDependencies(AbstractDependencyGraph<String> dependencyGraph,
			List<String> visitedOrder) {

		if (visitedOrder.size() > dependencyGraph.size()) {
			Assert.fail("More items were visited than the number of items in the graph");
		}
		if (visitedOrder.size() < dependencyGraph.size()) {
			Assert.fail("Not all items in the graph were visited");
		}

		HashSet<String> items = new HashSet<>(visitedOrder);
		if (items.size() != visitedOrder.size()) {
			Assert.fail("duplicate item(s) in linearOrder\n");
		}

		HashMap<String, Integer> visitedOrderMap = new HashMap<>();
		for (int i = 0; i < visitedOrder.size(); i++) {
			visitedOrderMap.put(visitedOrder.get(i), i);
		}

		for (String key : dependencyGraph.getValues()) {
			Integer visitedOrdinal = visitedOrderMap.get(key);
			if (visitedOrdinal == null) {
				Assert.fail("dependencyGraph key " + key + " not in linearOrder\n");
			}

			Set<String> dependents = dependencyGraph.getDependentValues(key);
			for (String dependent : dependents) {
				if (key.equals(dependent)) {
					Assert.fail("dependencyGraph key " + key + " depends on itself\n");
				}
				Integer dependentVisitedOrdinal = visitedOrderMap.get(dependent);
				if (dependentVisitedOrdinal == null) {
					Assert.fail("dependent " + dependent + " of dependencyGraph key " + key +
						" not in linearOrder\n");
				}
				if (dependentVisitedOrdinal <= visitedOrdinal) {
					Assert.fail("dependent " + dependent + " of dependencyGraph key " + key +
						" came first (" + dependentVisitedOrdinal + " < " + visitedOrdinal + ")\n");
				}
			}
		}
	}
Given a dependency map, does the captured linear order of execution 
satisfy the ordering constraints?
@param <T> the type of the keys being compared
@param dependencyGraph a map where keys are predecessors and values 
       are successors that depend on the respective key
@param visitedOrder the actual execution order to be tested
@return
Ghidra/Framework/Generic/src/test/java/ghidra/util/datastruct/DependencyGraphTest.java