boolean matchName, noMatch; String tagName = null; short matchNodeType;
boolean matchOnElement, matchFound; short findNodeType;
    protected void compareNodeList(NodeList control, NodeList test,    int numNodes, DifferenceListener listener) throws DifferenceFoundException {        Node nextControl, nextTest = null;        int j = 0;        int lastTestNode = test.getLength() - 1;        boolean matchName, noMatch;        String tagName = null;        short matchNodeType;        testTracker.preloadNodeList(test);        for (int i=0; i < numNodes; ++i) {            nextControl = control.item(i);            if (nextControl instanceof Element) {                matchName = true;                tagName = nextControl.getNodeName();            } else {                matchName = false;            }            matchNodeType = nextControl.getNodeType();            int startAt = ( i > lastTestNode ? lastTestNode : i);            j = startAt;                        noMatch = true;            while (noMatch) {                if (matchName && test.item(j) instanceof Element                && test.item(j).getNodeName().equals(tagName)) {                    noMatch = false;                } else if (!matchName                && matchNodeType == test.item(j).getNodeType()) {                    noMatch = false;                } else {                    ++j;                    if (j > lastTestNode) {                        j = 0;                    }                    if (j == startAt) {                        // been through all children                        noMatch = false;                    }                }            }            nextTest = test.item(j);            compare(new Integer(i), new Integer(j),                nextControl, nextTest, listener, CHILD_NODELIST_SEQUENCE);            compareNode(nextControl, nextTest, listener);        }    }