private void verifyStructure(NamedNode node, UniqueId id) {
        Deque<String> path = new ArrayDeque<>();
        while (node != root)  {
            path.push(node.id);
            node = node.parent;
        }
        Deque<String> segments = new ArrayDeque<>();
        if (id != null) for (Segment segment : id.getSegments())
            segments.add(segment.getValue());

        if ( ! List.copyOf(path).equals(List.copyOf(segments)))
            throw new IllegalStateException("test node " + segments + " referenced, but expected " + path);
    }
Verify the path from the root to the current node corresponds to the given id.
vespa-osgi-testrunner/src/main/java/com/yahoo/vespa/testrunner/TestReport.java