private static String format(final String str,
                                 final Function<String, String> formatter) {
        String result = NullSafe.string(str);
        if (formatter != null) {
            result = formatter.apply(result);
        }
        return result;
    }
Parses a template like '${accountId}_${component}_static_text' and returns
a {@link Templator} that can be used many times to build strings from
the parsed template.
<p>
The case sensitivity will depend on the implementation of the map
passed to {@link Templator#parseTemplate(String)}.
</p>

@param template            The template string to parse.
@param paramFormatter      An optional formatter that will be called on all
                           parameterised parts of the resolved string,
                           e.g. {@link String#toUpperCase()} and/or to replace unwanted chars.
@param staticTextFormatter An optional formatter that will be called on all
                           static parts of the template
                           e.g. {@link String#toUpperCase()} and/or to replace unwanted chars.
stroom-util/src/main/java/stroom/util/string/TemplateUtil.java