TitleField extends Field { @Override public FieldType getFieldType() { return FieldType.TITLE_FIELD; } TitleField(OdfElement odfElement); TextTitleElement getOdfElement(); @Override FieldType getFieldType();  }
@Test public void testGetFieldType() { try { TextDocument doc = TextDocument.newTextDocument(); TitleField titleField = Fields.createTitleField(doc.newParagraph("The Title:")); Assert.assertNotNull(titleField); FieldType fType = titleField.getFieldType(); Assert.assertEquals(fType, FieldType.TITLE_FIELD); } catch (Exception e) { Logger.getLogger(TitleFieldTest.class.getName()).log(Level.SEVERE, null, e); Assert.fail(e.getMessage()); } }