ChapterField extends Field { @Override public FieldType getFieldType() { return FieldType.CHAPTER_FIELD; } ChapterField(OdfElement odfElement); void setDisplayPage(DisplayType type); void setOutlineLevel(int level); TextChapterElement getOdfElement(); @Override FieldType getFieldType();  }
@Test public void testGetFieldType() { try { TextDocument doc = TextDocument.loadDocument(ResourceUtilities.getTestResourceAsStream(TEST_DOCUMENT)); ChapterField chapterField = Fields.createChapterField(doc.newParagraph("Chapter:")); FieldType fieldType = chapterField.getFieldType(); Assert.assertNotNull(fieldType); Assert.assertEquals(FieldType.CHAPTER_FIELD, fieldType); } catch (Exception e) { Logger.getLogger(ChapterFieldTest.class.getName()).log(Level.SEVERE, null, e); Assert.fail(e.getMessage()); } }