ViewHelper { public String summarize(BaseDocumentation doc, int length, String elideText) { StringBuffer summary = new StringBuffer(doc.summarize(length)); if(length == summary.length()) { summary.append(elideText); } return summary.toString(); }  String sectionHeaderText(int section, int subsection, FunctionDocumentation functionDocumentation); String sectionAnchor(int section, int subsection); String sectionNumber(int section, int subsection); String href(String id); String href(ItemDocumentation itemDocumentation); String href(ItemDocumentationSupport ids); String itemAnchor(ItemDocumentation itemDocumentation); String memberText(GroupDocumentation g, GroupMember m); String summarize(BaseDocumentation doc, int length, String elideText);  }
@Test public void testSummarize() { assertEquals("", vh.summarize(doc, 4, "...")); doc.setDescription(new Description("123")); assertEquals("123", vh.summarize(doc, 4, "...")); doc.setDescription(new Description("1234")); assertEquals("1234...", vh.summarize(doc, 4, "...")); doc.setDescription(new Description("12345")); assertEquals("1234...", vh.summarize(doc, 4, "...")); }