### Question:
TemplateUtils { public static String replaceTemplateData(final String content, final Map<String, Object> data) { if (Strings.isNullOrEmpty(content)) { return content; } try { final Writer writer = new StringWriter(); final MustacheFactory mf = new DefaultMustacheFactory(); final StringReader reader = new StringReader(content); final Mustache mustache = mf.compile(reader, content); mustache.execute(writer, data); writer.flush(); return writer.toString(); } catch (IOException e) { log.error("Error flushing template", e); } return content; } private  TemplateUtils(); static List<PropertyWrapper> parseBeanProperties(final Path beanPath); static String replaceStringPlaceholders(final String content, final Map<String, String> data); static String replaceTemplateData(final String content, final Map<String, Object> data); static String injectTemplate(final String templateName, final Map<String, Object> data, final Class<?> clazz);  }### Answer:
@Test public void testReplaceTemplateDataHttl() throws Exception { final Map<String, Object> data = new HashMap<>(); data.put("beanReference", "com.foo.bar"); final String result = TemplateUtils.replaceTemplateData("test_template_httl.ftl", data); log.info("result {}", result); }
@Test public void testInjectTemplateContent() throws Exception { final Map<String, Object> data = new HashMap<>(); data.put("namespace", "myNamespace"); String result = TemplateUtils.replaceTemplateData("test {{namespace}}", data); log.info("result {}", result); assertTrue(result.contains("myNamespace")); }