private boolean diffFiles(final Path actualFile, final Path expectedFile) throws IOException {

        final String expected = Files.readString(expectedFile);
        final String actual = Files.readString(actualFile);

        // The expected file has already had the DW lines removed
        final List<String> expectedLines = expected.lines().collect(Collectors.toList());
        final List<String> actualLines = actual.lines().collect(Collectors.toList());

        // write the actual out so we can compare in other tools
        Files.write(actualFile, actualLines);
        final Patch<String> patch = DiffUtils.diff(expectedLines, actualLines);

        final List<String> unifiedDiff = DiffUtils.generateUnifiedDiff(
                expectedFile.toString(),
                actualFile.toString(),
                expectedLines,
                patch,
                3);

        if (!unifiedDiff.isEmpty()) {
            System.out.println("\n  Differences exist!");

            System.out.println();
            unifiedDiff.forEach(diffLine -> {

                final ConsoleColour lineColour;
                if (diffLine.startsWith("+")) {
                    lineColour = ConsoleColour.GREEN;
                } else if (diffLine.startsWith("-")) {
                    lineColour = ConsoleColour.RED;
                } else {
                    lineColour = ConsoleColour.NO_COLOUR;
                }

                System.out.println(ConsoleColour.colourise(diffLine, lineColour));
            });
            System.out.println("\n To see the diff in Vim run:");
            System.out.println("vimdiff "
                               + expectedFile.toAbsolutePath().normalize()
                               + " "
                               + actualFile.toAbsolutePath().normalize());
            return true;
        } else {
            System.out.println("\n Files are the same");
            return false;
        }
    }
Show a proper coloured unified diff of the two files
stroom-query/stroom-query-common/src/test/java/stroom/query/common/v2/TestSerialisation.java