Compare two comments
@param control
@param test
@param listener
@throws DifferenceFoundException
519136
protected void compareComment(Comment control, Comment test,
                                  DifferenceListener listener) throws DifferenceFoundException {
        if (!XMLUnit.getIgnoreComments()) {
            compareCharacterData(control, test, listener, COMMENT_VALUE);
        }
    }
166758
public static void assertXpathValuesEqual(String controlXpath,
                                              String testXpath,
                                              Document document)
        throws XpathException {
        assertXpathValuesEqual(controlXpath, document, testXpath, document);
    }
1091168
public boolean qualifyForComparison(Element control, Element test) {
        return ElementSelectors.byName.canBeCompared(control, test);
    }
1331377
public static void compareResults(Map<URL, MatchResult> inputMatches,
                                      Map<URL, MatchResult> inputMatchesAlt) {

        MapDifference<URL, MatchResult> diff = Maps.difference(inputMatches, inputMatchesAlt);
        System.out.println("Comparing Match Results Maps");

        Map<URL, MatchResult> common = diff.entriesInCommon();
        System.out.println("Entries in common");
        showMapDetails(common);

        Map<URL, MatchResult> onlyLeft = diff.entriesOnlyOnLeft();
        System.out.println("Entries only in the left map");
        showMapDetails(common);

        Map<URL, MatchResult> onlyRight = diff.entriesOnlyOnRight();
        System.out.println("Entries only in the right map");
        showMapDetails(common);

        Map<URL, ValueDifference<MatchResult>> diffValues = diff.entriesDiffering();
        System.out.println("Differing values");
        for (Entry<URL, ValueDifference<MatchResult>> entry : diffValues.entrySet()) {
            MatchResult resultLeft = entry.getValue().leftValue();
            MatchResult resultRight = entry.getValue().rightValue();

            System.out.println("Match " + entry.getKey().toString());
            System.out.println("Left value details: ");
            System.out.println("Match explanation: " + resultLeft.getExplanation());

            System.out.println("Right value details: ");
            System.out.println("Match explanation: " + resultRight.getExplanation());
        }

    }
643128
protected boolean similar(Text control, Text test) {
        if (control == null) {
            return test == null;
        } else if (test == null) {
            return false;
        }
        return control.getNodeValue().equals(test.getNodeValue());
    }
247349
private ComparisonState compareAttributes(Attr control,
                                              XPathContext controlContext,
                                              Attr test,
                                              XPathContext testContext) {
        return compareAttributeExplicitness(control, controlContext, test,
                                            testContext).apply()
            .andThen(new Comparison(ComparisonType.ATTR_VALUE,
                                    control, getXPath(controlContext),
                                    control.getValue(), getParentXPath(controlContext),
                                    test, getXPath(testContext),
                                    test.getValue(), getParentXPath(testContext)));
    }
382446
public static void assertXpathValuesNotEqual(String controlXpath,
                                                 Document controlDocument,
                                                 String testXpath,
                                                 Document testDocument)
        throws XpathException {
        XpathEngine xpath = XMLUnit.newXpathEngine();
        String control = xpath.evaluate(controlXpath, controlDocument);
        String test = xpath.evaluate(testXpath, testDocument);
        if (control!=null) {
            if (control.equals(test)) {
                fail("Expected test value NOT to be equal to control but both were "
                     + test);
            }
        } else if (test == null) {
            fail("Expected test value NOT to be equal to control but both were empty");
        }
    }
874679
static void assertEquals(String message, Object comparison1, Object comparison2)
    {
        if(comparison1 == comparison2)
        {
            return;
        }
        if(comparison1.equals(comparison2))
        {
            return;
        }

        System.err.println(message);
    }
840958
public static void listen(int tryCount, long delay, ClipboardListener listener, boolean sync) {
		ClipboardMonitor.INSTANCE//
				.setTryCount(tryCount)//
				.setDelay(delay)//
				.addListener(listener)//
				.listen(sync);
	}
595912
public int differenceFound(Difference difference) {
        final int returnValue = super.differenceFound(difference);
        switch (returnValue) {
        case RETURN_IGNORE_DIFFERENCE_NODES_IDENTICAL:
            return returnValue;
        case RETURN_ACCEPT_DIFFERENCE:
            break;
        case RETURN_IGNORE_DIFFERENCE_NODES_SIMILAR:
            difference.setRecoverable(true);
            break;
        case RETURN_UPGRADE_DIFFERENCE_NODES_DIFFERENT:
            difference.setRecoverable(false);
            break;
        default:
            throw new IllegalArgumentException(returnValue
                                               + " is not a defined "
                                               + " DifferenceListener"
                                               + ".RETURN_... value");
        }
        allDifferences.add(difference);
        return returnValue;
    }
875741
private static AssertionError createComparisonFailure(final String reason, final String controlString,
            final String testString) {
        try {
            if (comparisonFailureConstructor == null) {
                final ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
                Class<?> comparisonFailureClass = classLoader.loadClass("org.junit.ComparisonFailure");
                comparisonFailureConstructor = comparisonFailureClass.getConstructor(String.class, String.class,
                    String.class);
            }
            return (AssertionError) comparisonFailureConstructor.newInstance(reason, controlString, testString);
        } catch (Exception e) {
            // ClassNotFoundException, NoSuchMethodException, InstantiationException,
            // IllegalAccessException, InvocationTargetException
            LOGGER.info("Either add junit to your classpath or do not call '.throwComparisonFailure()'. " + e);
        }

        return null;
    }
1341935
public static void assertXMLNotEqual(Reader control, Reader test)
        throws SAXException, IOException {
        assertXMLNotEqual(null, control, test);
    }
834121
private DeferredComparison compareDeclarations(final Document control,
                                                   final XPathContext controlContext,
                                                   final Document test,
                                                   final XPathContext testContext) {
        return new DeferredComparison() {
            @Override
            public ComparisonState apply() {
                return
                    compare(new Comparison(ComparisonType.XML_VERSION,
                                           control, getXPath(controlContext),
                                           control.getXmlVersion(), getParentXPath(controlContext),
                                           test, getXPath(testContext),
                                           test.getXmlVersion(), getParentXPath(testContext)))
                    .andThen(new Comparison(ComparisonType.XML_STANDALONE,
                                            control, getXPath(controlContext),
                                            control.getXmlStandalone(), getParentXPath(controlContext),
                                            test, getXPath(testContext),
                                            test.getXmlStandalone(), getParentXPath(testContext)))
                    .andThen(new Comparison(ComparisonType.XML_ENCODING,
                                            control, getXPath(controlContext),
                                            control.getXmlEncoding(), getParentXPath(controlContext),
                                            test, getXPath(testContext),
                                            test.getXmlEncoding(), getParentXPath(testContext)));
            }
        };
    }
872489
public CompareAssert and(Object control) {
        isNotNull();
        try {
            return CompareAssert.create(actual, control, prefix2Uri, dbf);
        } catch (Exception e) {
            throwAssertionError(shouldNotHaveThrown(e));
        }
        return null; //fix compile issue
    }
1056711
public static Diff compareXML(String control, Reader test)
        throws SAXException, IOException {
        return new Diff(new StringReader(control), test);
    }
926682
public void tryCompare() throws CmsException {

        CmsObject cms = A_CmsUI.getCmsObject();
        CheckBox check1 = m_group1.getSelected();
        CheckBox check2 = m_group2.getSelected();
        if (!canCompare(check1, check2)) {
            Notification.show(
                CmsVaadinUtils.getMessageText(Messages.GUI_HISTORY_DIALOG_SELECT_TWO_DIFFERENT_VERSIONS_0));
        } else {
            CmsHistoryResourceBean bean1 = (CmsHistoryResourceBean)(check1.getData());
            CmsHistoryResourceBean bean2 = (CmsHistoryResourceBean)(check2.getData());
            VerticalLayout diffContainer = new VerticalLayout();
            diffContainer.setSpacing(true);
            for (I_CmsDiffProvider diff : m_diffs) {
                Optional<Component> optionalDiff = diff.diff(cms, bean1, bean2);
                if (optionalDiff.isPresent()) {
                    diffContainer.addComponent(optionalDiff.get());
                }
            }
            Panel panel = new Panel();
            panel.setSizeFull();
            diffContainer.setWidth("100%");
            diffContainer.setMargin(true);
            panel.addStyleName(ValoTheme.PANEL_BORDERLESS);
            panel.setContent(diffContainer);
            openChildDialog(
                CmsHistoryDialog.this,
                panel,
                CmsVaadinUtils.getMessageText(Messages.GUI_HISTORY_DIALOG_COMPARE_0));
        }

    }
725673
public static void assertXMLEqual(String err, Document control,
                                      Document test) {
        Diff diff = new Diff(control, test);
        assertXMLEqual(err, diff, true);
    }