ListItem implements ListContainer { public Iterator<List> getListIterator() { return listContainerImpl.getListIterator(); } ListItem(TextListItemElement element);   ListItem(TextListItemElement element, String content); TextListItemElement getOdfElement(); String getTextContent(); void setTextContent(String content); void remove(); Integer getStartNumber(); void setStartNumber(Integer number); String getNumberFormat(); void setNumberFormat(String format); int getIndex(); List getOwnerList(); @Override String toString(); OdfElement getListContainerElement(); List addList(); List addList(ListDecorator decorator); void clearList(); Iterator<List> getListIterator(); boolean removeList(List list);  }
@Test public void testListIterator() { try { TextDocument odtdoc = TextDocument.loadDocument(ResourceUtilities .getTestResourceAsStream(SAMPLE_LIST_DOCUMENT_2)); Iterator<List> listIterator = odtdoc.getListIterator(); final List bodyList = listIterator.next(); Assert.assertEquals("body list should have 2 items", 2, bodyList.size()); Assert.assertTrue("iterator should have 1 more list (in the Section)", listIterator.hasNext()); final List sectionList = listIterator.next(); Assert.assertEquals("section list should have 3 items", 3, sectionList.size()); Assert.assertFalse("iterator should have no more lists", listIterator.hasNext()); } catch (Exception e) { Logger.getLogger(ListItemTest.class.getName()).log(Level.SEVERE, null, e); Assert.fail(e.getMessage()); } }