CompareTool { String convertProducerLine(String producer) { return producer.replaceAll(VERSION_REGEXP, VERSION_REPLACEMENT).replaceAll(COPYRIGHT_REGEXP, COPYRIGHT_REPLACEMENT); } CompareTool();   CompareTool(String gsExec, String compareExec); CompareResult compareByCatalog(PdfDocument outDocument, PdfDocument cmpDocument); CompareTool disableCachedPagesComparison(); CompareTool setCompareByContentErrorsLimit(int compareByContentMaxErrorCount); CompareTool setGenerateCompareByContentXmlReport(boolean generateCompareByContentXmlReport); void setEventCountingMetaInfo(IMetaInfo metaInfo); CompareTool enableEncryptionCompare(); ReaderProperties getOutReaderProperties(); ReaderProperties getCmpReaderProperties(); String compareVisually(String outPdf, String cmpPdf, String outPath, String differenceImagePrefix); String compareVisually(String outPdf, String cmpPdf, String outPath, String differenceImagePrefix, Map<Integer, List<Rectangle>> ignoredAreas); String compareByContent(String outPdf, String cmpPdf, String outPath); String compareByContent(String outPdf, String cmpPdf, String outPath, String differenceImagePrefix); String compareByContent(String outPdf, String cmpPdf, String outPath, String differenceImagePrefix, byte[] outPass, byte[] cmpPass); String compareByContent(String outPdf, String cmpPdf, String outPath, String differenceImagePrefix, Map<Integer, List<Rectangle>> ignoredAreas); String compareByContent(String outPdf, String cmpPdf, String outPath, String differenceImagePrefix, Map<Integer, List<Rectangle>> ignoredAreas, byte[] outPass, byte[] cmpPass); boolean compareDictionaries(PdfDictionary outDict, PdfDictionary cmpDict); CompareResult compareDictionariesStructure(PdfDictionary outDict, PdfDictionary cmpDict); CompareResult compareDictionariesStructure(PdfDictionary outDict, PdfDictionary cmpDict, Set<PdfName> excludedKeys); CompareResult compareStreamsStructure(PdfStream outStream, PdfStream cmpStream); boolean compareStreams(PdfStream outStream, PdfStream cmpStream); boolean compareArrays(PdfArray outArray, PdfArray cmpArray); boolean compareNames(PdfName outName, PdfName cmpName); boolean compareNumbers(PdfNumber outNumber, PdfNumber cmpNumber); boolean compareStrings(PdfString outString, PdfString cmpString); boolean compareBooleans(PdfBoolean outBoolean, PdfBoolean cmpBoolean); String compareXmp(String outPdf, String cmpPdf); String compareXmp(String outPdf, String cmpPdf, boolean ignoreDateAndProducerProperties); boolean compareXmls(byte[] xml1, byte[] xml2); boolean compareXmls(String outXmlFile, String cmpXmlFile); String compareDocumentInfo(String outPdf, String cmpPdf, byte[] outPass, byte[] cmpPass); String compareDocumentInfo(String outPdf, String cmpPdf); String compareLinkAnnotations(String outPdf, String cmpPdf); String compareTagStructures(String outPdf, String cmpPdf);  }
@Test public void versionReplaceTest() { String initial = "iText® 1.10.10-SNAPSHOT (licensed to iText) ©2000-2018 iText Group NV"; String replacedExpected = "iText® <version> (licensed to iText) ©<copyright years> iText Group NV"; Assert.assertEquals(replacedExpected, new CompareTool().convertProducerLine(initial)); }