private static void assertFileContains(File application, Map<String, File> files,
                                           String fileName, String expectedContent) {
        if (WRITE_FILES) {
            files.put(fileName, writeFile(application, fileName, expectedContent.trim() + "\n"));
        }
        if (!files.containsKey(fileName)) {
            fail("Expected file '" + fileName + "' not found.\nExpected content: " + expectedContent);
            return;
        }
        StringBuilder content = new StringBuilder();

        try {
            BufferedReader reader = new BufferedReader(new FileReader(files.get(fileName)));
            String line = reader.readLine();
            while (line != null) {
                content.append(line).append("\n");
                line = reader.readLine();
            }
            reader.close();
        } catch (FileNotFoundException e) {
            fail("File '" + fileName + "' not found.");
        } catch (IOException e) {
            fail("Failed to read content of file '" + fileName + ".");
        }

        assertEquals(content.toString().trim(), expectedContent.replace("\r", "").trim());
    }
Tests whether or not a given file exists and contains some expected content.

@param application     The application directory.
@param files           The filtered list of files within the application.
@param fileName        The name of the file whose content to check.
@param expectedContent The content required in the file being checked.
config-model/src/test/java/com/yahoo/vespa/model/routing/test/RoutingTestCase.java