Description { public String toHtml() { StringBuffer sb = new StringBuffer(); if (this.paragraphs != null) { for (Paragraph paragraph : this.paragraphs) { sb.append(paragraph.toHtml()); } } return sb.toString(); } Description();  Description(String text);  Description(List<Paragraph> paragraphs); boolean hasText(); String summarize(int length); String joinText(String between); List<Paragraph> getParagraphs(); void setParagraphs(List<Paragraph> paragraphs); @Override String toString(); String toHtml();  }
@Test public void testToHtml() { Description desc = new Description(paragraphs); assertEquals("",desc.toHtml()); Paragraph paragraphOne = new Paragraph("Blah, blah, blah"); this.paragraphs.add(paragraphOne); assertEquals("<p>Blah, blah, blah</p>",desc.toHtml()); Paragraph paragraphTwo = new Paragraph("Once upon a time"); this.paragraphs.add(paragraphTwo); assertEquals("<p>Blah, blah, blah</p><p>Once upon a time</p>",desc.toHtml()); }