private static ObjectMapper createYamlObjectMapper(final boolean indent) {
        final YAMLFactory yamlFactory = new YAMLFactory();
        return new ObjectMapper(yamlFactory)
                .registerModule(new Jdk8Module()) // Needed to deal with Optional<...>
//                .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false)
//        mapper.configure(DeserializationFeature.UNWRAP_ROOT_VALUE, true);
                .configure(SerializationFeature.INDENT_OUTPUT, indent)
                .configure(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS, true)
//        mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true);
                .setSerializationInclusion(Include.NON_NULL);
    }
No configurations apart from registering {@link Jdk8Module} for {@link java.util.Optional}
use.
stroom-util/src/main/java/stroom/util/yaml/YamlUtil.java