TextContentReplacement implements TextContent { @Override public String text(TRenderContext content) { Object value = content.getModelValue(key); if (value == null) { value = key; } for (TextContentFilter filter : filters) { value = filter.process(content, value.toString()); } return value.toString(); } TextContentReplacement(String key, List<? extends TextContentFilter> filters); @Override String text(TRenderContext content); @Override String toString();  }
@Test public void testText() throws Exception { final TextContentReplacement textContentReplacement = new TextContentReplacement("key", Lists.<TextContentFilter>newArrayList()); String expected = "value"; Map<String, Object> model = Maps.newHashMap(); model.put("key", expected); assertCorrectText(textContentReplacement, expected, model); }