KyeroDocument extends XmlConvertableDocument<Root, KyeroVersion> { @Override public Root toObject() throws JAXBException { this.upgradeToLatestVersion(); return (Root) KyeroUtils.createUnmarshaller().unmarshal(this.getDocument()); } KyeroDocument(Document document); @Override KyeroVersion getDocumentVersion(); @Override KyeroVersion getLatestVersion(); static boolean isReadable(Document doc); static KyeroDocument newDocument(); static KyeroDocument newDocument(Root root); @Override void setDocumentVersion(KyeroVersion version); @Override Root toObject();  }
@Test public void testToObject() { try { String version = KyeroUtils.VERSION.toXmlVersion(); KyeroDocument doc = new KyeroDocument(buildExampleDocument(version)); Assert.assertEquals(version, KyeroUtils.VERSION, doc.getDocumentVersion()); Root obj = doc.toObject(); Assert.assertNotNull( "Created object for transfer document.", obj); Assert.assertEquals( "Matching version between document and object.", doc.getDocumentVersion().toXmlVersion(), obj.getKyero().getFeedVersion()); } catch (Exception ex) { LOGGER.error("Test of KyeroDocument.toObject failed!"); LOGGER.error("> " + ex.getLocalizedMessage(), ex); Assert.fail("Test of KyeroDocument.toObject failed!"); } }