Textbox extends Frame implements ListContainer, ParagraphContainer { public Paragraph getParagraphByIndex(int index, boolean isEmptyParagraphSkipped) { return getParagraphContainerImpl().getParagraphByIndex(index, isEmptyParagraphSkipped); } private  Textbox(DrawTextBoxElement textbox); static Textbox getInstanceof(DrawTextBoxElement element); static Textbox newTextbox(TextboxContainer container); void setTextContent(String content); void clearContent(); String getTextContent(); @Override DrawTextBoxElement getOdfElement(); List addList(); List addList(ListDecorator decorator); void clearList(); OdfElement getListContainerElement(); Iterator<List> getListIterator(); boolean removeList(List list); Paragraph addParagraph(String textContent); OdfElement getParagraphContainerElement(); boolean removeParagraph(Paragraph para); Paragraph getParagraphByIndex(int index, boolean isEmptyParagraphSkipped); Paragraph getParagraphByReverseIndex(int reverseIndex, boolean isEmptyParagraphSkipped); Iterator<Paragraph> getParagraphIterator();  }
@Test public void testGetRemoveTextbox() { int count = 0; try { TextDocument doc = TextDocument.loadDocument(ResourceUtilities.getTestResourceAsStream("SampleBox.odt")); count = countAllTextbox(doc); Assert.assertEquals(8, count); int c = 0; Paragraph p = doc.getParagraphByIndex(1, true); Iterator<Textbox> boxIter = p.getTextboxIterator(); while (boxIter.hasNext()) { Textbox box = boxIter.next(); if (p.removeTextbox(box)) ; c++; } count = countAllTextbox(doc); Assert.assertEquals(8 - c, count); doc.save(ResourceUtilities.newTestOutputFile("SampleBoxOutput.odt")); } catch (Exception e) { Logger.getLogger(TextBoxTest.class.getName()).log(Level.SEVERE, null, e); Assert.fail(); } }