### Question:
TemplateParamsExtractUtil { public static Map<String, Object> getParams(String originContent, List<SearchTemplate> allFiles) { String content = "{\n\"template\":\"" + renderMacrosThenFormat(originContent, allFiles) + "\"\n}"; Map<String, Object> params = new LinkedHashMap<>(); walk(content, 0, content.length()-1, "", params, null); return params; }  static Map<String, Object> getParams(String originContent, List<SearchTemplate> allFiles); static String renderESTemplateBody(String originContent, List<SearchTemplate> allFiles); static String renderMacrosThenFormat(String originContent, List<SearchTemplate> allFiles);  }### Answer:
@Test public void testGetParams () { SearchTemplate t = new SearchTemplate(); t.setTemplateName("test"); t.setContent("{{#b}}{{/b}}{{^c}}{{/c}}"); List<SearchTemplate> list = new LinkedList<>(); list.add(t); String s = "{{#a}}{{a}}{{/a}}##__test__##{{null}}"; Map<String, Object> map = getParams(s, list); assertEquals(map.size(), 3); }