public static void main(String[] args) throws IOException {

        Path defaultsFile;
        Path schemaFile;
        if (args.length == 2) {
            defaultsFile = Paths.get(args[0]);
            schemaFile = Paths.get(args[1]);
        } else {
            defaultsFile = TestStroomYamlUtil.getExpectedYamlFilePath();
            schemaFile = null;
        }

        Path parentDir = defaultsFile.getParent();

        if (!Files.isDirectory(parentDir)) {
            LOGGER.info("Creating directory {}", defaultsFile.toAbsolutePath());
            Files.createDirectories(parentDir);
        }

        final String generatedYaml = TestStroomYamlUtil.getYamlFromJavaModel();


        List<String> outputLines;
        if (args.length > 0) {
            // called for a specific output location so add a header

            outputLines = generatedYaml.replace("---", "---\n" + HEADER)
                    .lines()
                    .collect(Collectors.toList());
        } else {
            // called manually for TestYamlUtil so don't modify the content else it will break the test
            outputLines = removeDropWizardLines(generatedYaml);
        }

        LOGGER.info("Writing generated yaml to {}", defaultsFile.toAbsolutePath());
        Files.write(defaultsFile, outputLines);

        if (!generatedYaml.contains(APP_CONFIG + ":")) {
            throw new RuntimeException(LogUtil.message("Expecting to find {} in {}",
                    APP_CONFIG + ":", defaultsFile.normalize().toAbsolutePath().toString()));
        }

        if (schemaFile != null) {
            generateJsonSchema(schemaFile);
        }
    }
Builds a fresh config object tree with all the hard coded default values
and generates the yaml serialised form of it, saving the result to the
EXPECTED_YAML_FILE_NAME file so that it can be used in
{@link TestStroomYamlUtil#testGeneratedYamlAgainstExpected()}
<p>
NOTE: This main method is called from the stroom-app gradle build so if it
is moved you will need to refactor that too.
stroom-config/stroom-config-app/src/test/java/stroom/config/app/GenerateExpectedYaml.java