### Question:
FreeMarkerGenerator { public String generate(String templateName, Map<String, Object> rootMap) { StringWriter writer = new StringWriter(); try { write(templateName, rootMap, writer); return writer.toString(); } catch (AutoException e) { ((AutoException) e).addDetailInfo("content=" + writer.toString()); throw e; } }  String generate(String templateName, Map<String, Object> rootMap); void write(String templateName, Map<String, Object> rootMap, Writer writer); void setConfiguration(Configuration configuration);  }### Answer:
@Test public void test1() throws Exception { Map<String, Object> rootMap = new HashMap<String, Object>(); rootMap.put("aaa", "AAA"); rootMap.put("bbb", "BBB"); rootMap.put("enable", Boolean.TRUE); rootMap.put("num", 12345.6789); Model model = new Model(); model.setEnabled(true); rootMap.put("model", model); String data = generator.generate("test1.ftl", rootMap); File file = new File("target/tmp/test1.txt"); FileUtils.writeStringToFile(file, data, "UTF-8"); }