BaseDocumentation implements Comparable<BaseDocumentation> { public String summarize(int length) { if(this.description != null) { return this.description.summarize(length); } return ""; } BaseDocumentation();  BaseDocumentation(String id, Description description); boolean isDocumented(); boolean hasText(); String getId(); Description getDescription(); void setId(String id); void setDescription(Description description); String summarize(int length); String joinDescriptionText(String between); @Override int hashCode(); @Override boolean equals(Object obj); @Override int compareTo(BaseDocumentation o);  }
@Test public void testSummarize() { Description description = new Description("xyz"); BaseDocumentation fd = new BaseDocumentation(); assertTrue(fd.summarize(2).isEmpty()); fd.setDescription(description); assertEquals(description.summarize(2), fd.summarize(2)); }