ChapterField extends Field { public TextChapterElement getOdfElement() { return chapterElement; } ChapterField(OdfElement odfElement); void setDisplayPage(DisplayType type); void setOutlineLevel(int level); TextChapterElement getOdfElement(); @Override FieldType getFieldType();  }
@Test public void testGetOdfElement() { try { TextDocument doc = TextDocument.loadDocument(ResourceUtilities.getTestResourceAsStream("headerFooterHidden.odt")); ChapterField chapterField = Fields.createChapterField(doc.addParagraph("Chapter:").getOdfElement()); chapterField.setOutlineLevel(1); TextChapterElement tchapterEle = chapterField.getOdfElement(); Assert.assertNotNull(tchapterEle); Assert.assertEquals("chapter", tchapterEle.getLocalName()); Assert.assertEquals("text:chapter", tchapterEle.getNodeName()); } catch (Exception e) { Logger.getLogger(ChapterFieldTest.class.getName()).log(Level.SEVERE, null, e); Assert.fail(e.getMessage()); } }