ListDecorator numberDecorator = new NumberDecorator(doc);
ListDecorator outLineDecorator = new OutLineDecorator(doc);
String[] subItemContents = { "sub list item 1", "sub list item 2",
"sub list item 3" };
List list1 = new List(sect);
boolean removeResult = sect.removeList(list1);
Assert.assertTrue(removeResult);
List list2 = new List(sect, numberDecorator);
list2.addItems(subItemContents);
Assert.assertEquals(ListDecorator.ListType.NUMBER, list2.getType());
removeResult = sect.removeList(list2);
Assert.assertTrue(removeResult);
List list3 = new List(sect, "Bullet List", null);
list3.addItems(subItemContents);
Assert.assertEquals(ListDecorator.ListType.BULLET, list3.getType());
removeResult = sect.removeList(list3);
Assert.assertTrue(removeResult);
List list4 = sect.addList();
removeResult = sect.removeList(list4);
Assert.assertTrue(removeResult);
List list5 = sect.addList(outLineDecorator);
list5.addItems(subItemContents);
Assert.assertEquals(ListDecorator.ListType.NUMBER, list5.getType());
removeResult = sect.removeList(list5);
Assert.assertTrue(removeResult);
} catch (Exception e) {
Logger.getLogger(ListTest.class.getName()).log(Level.SEVERE, null,
e);