List { public ListType getType() { if (decorator != null) { return decorator.getListType(); } else { try { String textStyleName = listElement.getTextStyleNameAttribute(); Document doc = (Document) (((OdfFileDom) listElement.getOwnerDocument()).getDocument()); OdfContentDom contentDocument = doc.getContentDom(); OdfOfficeAutomaticStyles styles = contentDocument.getAutomaticStyles(); OdfOfficeStyles documentStyles = doc.getDocumentStyles(); OdfTextListStyle listStyle = styles.getListStyle(textStyleName); if (listStyle == null) { listStyle = documentStyles.getListStyle(textStyleName); } if (listStyle != null) { TextListLevelStyleElementBase listLevelStyle = listStyle.getLevel(1); if (listLevelStyle instanceof TextListLevelStyleBulletElement) { return ListType.BULLET; } else if (listLevelStyle instanceof TextListLevelStyleNumberElement) { return ListType.NUMBER; } else if (listLevelStyle instanceof TextListLevelStyleImageElement) { return ListType.IMAGE; } } } catch (Exception e) { Logger.getLogger(List.class.getName()).log(Level.SEVERE, null, e); } return null; } } List(TextListElement element);  List(ListContainer container);  List(ListContainer container, ListDecorator decorator);  List(ListContainer container, String header, ListDecorator decorator);  List(ListContainer container, String header, boolean isContinueNumbering, ListDecorator decorator);  List(ListContainer container, String header, List continueList, ListDecorator decorator); ListType getType(); String getHeader(); void setHeader(String header); void setDecorator(ListDecorator decorator); ListItem addItem(String itemContent); ListItem addItem(int location, String itemContent); ListItem addItem(ListItem item); ListItem addItem(int location, ListItem item); java.util.List<ListItem> addItems(String[] items); java.util.List<ListItem> addItems(int location, String[] items); java.util.List<ListItem> addItems(ListItem[] items); java.util.List<ListItem> addItems(int location, ListItem[] items); ListItem getItem(int location); java.util.List<ListItem> getItems(); int size(); ListItem set(int location, ListItem item); ListItem set(int location, String itemContent); boolean removeItem(int location); boolean removeItem(ListItem item); boolean removeItems(java.util.List<ListItem> items); void clear(); void remove(); boolean isContinueNumbering(); void setContinueNumbering(boolean isContinueNumbering); List getContinueList(); void setContinueList(List continueList); int getLevel(); TextListElement getOdfElement(); @Override String toString();  }
@Test public void testCreateRemoveList() { try { TextDocument doc = TextDocument.newTextDocument(); ListDecorator numberDecorator = new NumberDecorator(doc); List list1 = new List(doc); boolean removeResult = doc.removeList(list1); Assert.assertTrue(removeResult); List list2 = new List(doc, numberDecorator); Assert.assertEquals(ListDecorator.ListType.NUMBER, list2.getType()); removeResult = doc.removeList(list2); Assert.assertTrue(removeResult); List list3 = new List(doc, "List Header1", numberDecorator); Assert.assertEquals(ListDecorator.ListType.NUMBER, list3.getType()); removeResult = doc.removeList(list3); Assert.assertTrue(removeResult); List list4 = doc.addList(); removeResult = doc.removeList(list4); Assert.assertTrue(removeResult); List list5 = doc.addList(numberDecorator); Assert.assertEquals(ListDecorator.ListType.NUMBER, list5.getType()); removeResult = doc.removeList(list5); Assert.assertTrue(removeResult); } catch (Exception e) { Logger.getLogger(ListTest.class.getName()).log(Level.SEVERE, null, e); Assert.fail(e.getMessage()); } }