PreviewTemplate { String evaluate(String text) { if (text != null) { if (text.contains("${")) { for (String key : context.keySet()) { if (text.contains(expression(key))) { text = evaluate(text, key); } } } } return text; } private  PreviewTemplate(Map<String, String> context);   }
@Test public void nil() throws Exception { assertNull(community.evaluate(null)); }
@Test public void empty() throws Exception { assertEquals("", community.evaluate("")); }
@Test public void noop() throws Exception { assertEquals(LOREM, community.evaluate(LOREM)); assertEquals(LOREM_EXPRESSION, community.evaluate(LOREM_EXPRESSION)); }
@Test public void community() throws Exception { assertEquals(COMMUNITY, community.evaluate(TEMPLATE)); }
@Test public void product() throws Exception { assertEquals(PRODUCT, product.evaluate(TEMPLATE)); }