@Test public void testEvaluateHandlebarsTemplate() throws Exception { TemplateFactory templateFactory = new TemplateFactory(); String result = templateFactory.handlebars(TEMPLATE, createContext()); assertThat(result, is(EXPECTED_RESULT)); }
public String handlebars(String template, Object context) { Template handlebarsTemplate = compileHandlebarsTemplate(template); try { return handlebarsTemplate.apply(context); } catch (IOException e) { throw new TemplateException("Error evaluating handlebars template: " + template, e); } }
TemplateFactory { public String handlebars(String template, Object context) { Template handlebarsTemplate = compileHandlebarsTemplate(template); try { return handlebarsTemplate.apply(context); } catch (IOException e) { throw new TemplateException("Error evaluating handlebars template: " + template, e); } } }
TemplateFactory { public String handlebars(String template, Object context) { Template handlebarsTemplate = compileHandlebarsTemplate(template); try { return handlebarsTemplate.apply(context); } catch (IOException e) { throw new TemplateException("Error evaluating handlebars template: " + template, e); } }  }
TemplateFactory { public String handlebars(String template, Object context) { Template handlebarsTemplate = compileHandlebarsTemplate(template); try { return handlebarsTemplate.apply(context); } catch (IOException e) { throw new TemplateException("Error evaluating handlebars template: " + template, e); } }  String handlebars(String template, Object context); Template compileHandlebarsTemplate(String template); }
TemplateFactory { public String handlebars(String template, Object context) { Template handlebarsTemplate = compileHandlebarsTemplate(template); try { return handlebarsTemplate.apply(context); } catch (IOException e) { throw new TemplateException("Error evaluating handlebars template: " + template, e); } }  String handlebars(String template, Object context); Template compileHandlebarsTemplate(String template);  }