First point of call: if nodes are comparable it compares node values then
recurses to compare node children.
@param control
@param test
@param listener
@param elementQualifier
@throws DifferenceFoundException
9057
protected void compareNode(Node control, Node test,
                               DifferenceListener listener, ElementQualifier elementQualifier) 
        throws DifferenceFoundException {
        boolean comparable = compareNodeBasics(control, test, listener);
        boolean isDocumentNode = false;

        if (comparable) {
            switch (control.getNodeType()) {
            case Node.ELEMENT_NODE:
                compareElement((Element)control, (Element)test, listener);
                break;
            case Node.CDATA_SECTION_NODE:
            case Node.TEXT_NODE:
                compareText((CharacterData) control,
                            (CharacterData) test, listener);
                break;
            case Node.COMMENT_NODE:
                compareComment((Comment)control, (Comment)test, listener);
                break;
            case Node.DOCUMENT_TYPE_NODE:
                compareDocumentType((DocumentType)control,
                                    (DocumentType)test, listener);
                break;
            case Node.PROCESSING_INSTRUCTION_NODE:
                compareProcessingInstruction((ProcessingInstruction)control,
                                             (ProcessingInstruction)test, listener);
                break;
            case Node.DOCUMENT_NODE:
                isDocumentNode = true;
                compareDocument((Document)control, (Document) test, 
                                listener, elementQualifier);
                break;
            default:
                listener.skippedComparison(control, test);
            }
        } 

        compareHasChildNodes(control, test, listener);
        if (isDocumentNode) {
            Element controlElement = ((Document)control).getDocumentElement();
            Element testElement = ((Document)test).getDocumentElement();
            if (controlElement!=null && testElement!=null) {
                compareNode(controlElement, testElement, listener, elementQualifier);
            }
        } else {
            controlTracker.indent();
            testTracker.indent();
            compareNodeChildren(control, test, listener, elementQualifier);
            controlTracker.outdent();
            testTracker.outdent();
        }
    }
828045
public ExpressionBuilder notEquals(final SubordinateTrigger trigger, final Object compare) {
		BooleanExpression exp = new CompareExpression(CompareType.NOT_EQUAL, trigger, compare);
		appendExpression(exp);

		return this;
	}
173211
function(node) {
                assertRangeValid(this);

                var parent = node.parentNode;
                var nodeIndex = getNodeIndex(node);

                if (!parent) {
                    throw new DOMException("NOT_FOUND_ERR");
                }

                var startComparison = this.comparePoint(parent, nodeIndex),
                    endComparison = this.comparePoint(parent, nodeIndex + 1);

                if (startComparison < 0) { // Node starts before
                    return (endComparison > 0) ? n_b_a : n_b;
                } else {
                    return (endComparison > 0) ? n_a : n_i;
                }
            }
880531
protected boolean equalsNamespace(Node control, Node test) {
        String controlNS = control.getNamespaceURI();
        String testNS = test.getNamespaceURI();
        if (controlNS == null) {
            return testNS == null;
        }
        return controlNS.equals(testNS);
    }
792527
boolean matchStandaloneElement(
            final boolean blockMatching,
            final int markupLevel, final int markupBlockIndex, final SelectorElementBuffer elementBuffer) {

        checkMarkupLevel(markupLevel);

        if (this.markupSelectorItem.anyLevel() || markupLevel == 0 || (this.prev != null && this.prev.matchedMarkupLevels[markupLevel - 1])) {
            // This element has not matched yet, but might match, so we should check

            this.matchesThisLevel = this.markupSelectorItem.matchesElement(markupBlockIndex, elementBuffer, this.markupBlockMatchingCounter);

            if (matchesPreviousOrCurrentLevel(markupLevel)) {
                // This filter was already matched by a previous level (through an "open" event), so just delegate to next.

                if (this.next != null) {
                    return this.next.matchStandaloneElement(blockMatching, markupLevel, markupBlockIndex, elementBuffer);
                }
                return (blockMatching? true : this.matchesThisLevel);

            } else if (this.matchesThisLevel) {
                // This filter was not matched before. So the fact that it matches now means we need to consume it,
                // therefore not delegating.

                return (this.next == null);

            }

        } else if (matchesPreviousOrCurrentLevel(markupLevel)) {
            // This filter was already matched by a previous level (through an "open" event), so just delegate to next.

            if (this.next != null) {
                return this.next.matchStandaloneElement(blockMatching, markupLevel, markupBlockIndex, elementBuffer);
            }
            return blockMatching;

        }

        return false;

    }
1091168
public boolean qualifyForComparison(Element control, Element test) {
        return ElementSelectors.byName.canBeCompared(control, test);
    }
814247
public void skippedComparison(Node control, Node test) {
        if (differenceListenerDelegate != null) {
            differenceListenerDelegate.skippedComparison(control, test);
        } else {
            System.err.println("DifferenceListener.skippedComparison: "
                               + "unhandled control node type=" + control
                               + ", unhandled test node type=" + test);
        }
    }
1258631
@Override
  public void endVisit(MethodDeclaration node) {
    ExecutableElement element = node.getExecutableElement();
    if (!ElementUtil.getName(element).equals("compareTo") || node.getBody() == null) {
      return;
    }
    DeclaredType comparableType = typeUtil.findSupertype(
        ElementUtil.getDeclaringClass(element).asType(), "java.lang.Comparable");
    if (comparableType == null) {
      return;
    }
    List<? extends TypeMirror> typeArguments = comparableType.getTypeArguments();
    List<? extends VariableElement> parameters = element.getParameters();
    if (typeArguments.size() != 1 || parameters.size() != 1
        || !typeArguments.get(0).equals(parameters.get(0).asType())) {
      return;
    }

    VariableElement param = node.getParameter(0).getVariableElement();

    FunctionInvocation castCheck = createCastCheck(typeArguments.get(0), new SimpleName(param));
    if (castCheck != null) {
      node.getBody().addStatement(0, new ExpressionStatement(castCheck));
    }
  }
244701
public static void assertXpathExists(String xPathExpression, 
                                         InputSource control)
        throws IOException, SAXException, XpathException {
        Document inDocument = XMLUnit.buildControlDocument(control);
        assertXpathExists(xPathExpression, inDocument);
    }
824819
public static void assertXpathsEqual(String controlXpath,
                                         Document controlDocument,
                                         String testXpath,
                                         Document testDocument)
        throws XpathException {
        assertXpathEquality(controlXpath, controlDocument, testXpath,
                            testDocument, true);
    }
1278162
public static void assertXMLNotEqual(String err, Reader control, Reader test)
        throws SAXException, IOException {
        Diff diff = new Diff(control, test);
        assertXMLEqual(err, diff, false);
    }
757327
public <T> void compare(Comparison comparison, Label trueLabel, Local<T> a, Local<T> b) {
        adopt(trueLabel);
        Rop rop = comparison.rop(StdTypeList.make(a.type.ropType, b.type.ropType));
        addInstruction(new PlainInsn(rop, sourcePosition, null,
                RegisterSpecList.make(a.spec(), b.spec())), trueLabel);
    }
1244510
protected void compareText(Text control, Text test,
                               DifferenceListener listener)
        throws DifferenceFoundException {
        compareText((CharacterData) control, (CharacterData) test, listener);
    }
104836
public static List<Difference> getDifferences(String controlDom,
                                                  String testDom) {
        return getDifferences(controlDom, testDom,
                Lists.newArrayList());
    }
910936
public static void assertXMLEqual(String msg, Diff diff,
                                      boolean assertion) {       
        if (assertion != diff.similar()) {
            fail(getFailMessage(msg, diff));
        }
    }
1208100
private ComparisonState
        compareDocTypes(DocumentType control,
                        XPathContext controlContext,
                        DocumentType test,
                        XPathContext testContext) {
        return compare(new Comparison(ComparisonType.DOCTYPE_NAME,
                                      control, getXPath(controlContext),
                                      control.getName(), getParentXPath(controlContext),
                                      test, getXPath(testContext),
                                      test.getName(), getParentXPath(testContext)))
            .andThen(new Comparison(ComparisonType.DOCTYPE_PUBLIC_ID,
                                    control, getXPath(controlContext),
                                    control.getPublicId(), getParentXPath(controlContext),
                                    test, getXPath(testContext),
                                    test.getPublicId(), getParentXPath(testContext)))
            .andThen(new Comparison(ComparisonType.DOCTYPE_SYSTEM_ID,
                                    control, null, control.getSystemId(), null,
                                    test, null, test.getSystemId(), null));
    }
860666
public static void assertXpathEvaluatesTo(String expectedValue,
                                              String xpathExpression,
                                              InputSource control)
        throws SAXException, IOException,
               XpathException {
        Document document = XMLUnit.buildControlDocument(control);
        assertXpathEvaluatesTo(expectedValue, xpathExpression, document);
    }