Description { public boolean hasText() { if (this.paragraphs != null) { for (Paragraph p : this.paragraphs) { if (p.hasText()) { return true; } } } return false; } 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 testHasText() { Description desc = new Description(); desc.setParagraphs(null); assertFalse(desc.hasText()); desc.setParagraphs(paragraphs); assertFalse(desc.hasText()); Paragraph p = new Paragraph(); assertFalse(p.hasText()); paragraphs.add(p); assertFalse(desc.hasText()); p.setText("x"); assertTrue(p.hasText()); assertTrue(desc.hasText()); }