code: static String substitute(String pattern, Map<String, String> vars) {
      String value = pattern;
      for (Map.Entry<String, String> entry : vars.entrySet()) {
        String raw = entry.getValue();
        String v = Introspector.decapitalize(raw);
        value = value.replace("{raw:" + entry.getKey() + "}", raw);
        value = value.replace("{" + entry.getKey() + "}", v);
      }
      return value;
    }
docs: Substitute named variables in the pattern string with the corresponding
  values in the variables map.
  
  @param pattern
  Pattern string with placeholders, name surounded by curly braces, e.g.:
  {@code {variable name}}.
  @param vars
  Map of variable substitutions that are available.
  @return
  String with values substituted in. If no matching key is found for a
  placeholder, then it will not be modified and left in place.