// For complete examples and data files, please go to https://github.com/groupdocs-comparison/GroupDocs.Comparison-for-Java
String sourcePath = Main.Utilities.sourcePath + sourceFile;
String targetPath = Main.Utilities.targetPath + targetFile;
// Create instance of GroupDocs.Comparison.Comparison and call method Compare.
Comparison comparison = new Comparison();
InputStream result = comparison.compare(sourcePath, targetPath, Main.Utilities.outputFileName(extension), ComparisonType.Words);