SubjectField extends Field { @Override public FieldType getFieldType() { return FieldType.SUBJECT_FIELD; } SubjectField(OdfElement odfElement); TextSubjectElement getOdfElement(); @Override FieldType getFieldType();  }
@Test public void testGetFieldType() { try { TextDocument doc = TextDocument.newTextDocument(); SubjectField subjectField = Fields.createSubjectField(doc.newParagraph("The Subject:")); FieldType fieldType = subjectField.getFieldType(); Assert.assertNotNull(subjectField); Assert.assertEquals(fieldType, FieldType.SUBJECT_FIELD); } catch (Exception e) { Logger.getLogger(SubjectFieldTest.class.getName()).log(Level.SEVERE, null, e); Assert.fail(e.getMessage()); } }