KeyFile { public Key getKey() { return key; } KeyFile();  KeyFile(boolean isXmlFile);  KeyFile(boolean isXmlFile, Key key); Key getKey(); boolean isXmlFile();  }
@Test public void shouldUnmarshallObject() { String xml = "<KeyFile><Key><Data>RP+rYNZL4lrGtDMBPzOuctlh3NAutSG5KGsT38C+qPQ=</Data></Key></KeyFile>"; ByteArrayInputStream inputStream = new ByteArrayInputStream(xml.getBytes()); KeyFile keyFile = new SimpleXmlParser().fromXml(inputStream, new NullProtectionStrategy(), KeyFile.class); Assert.assertEquals("RP+rYNZL4lrGtDMBPzOuctlh3NAutSG5KGsT38C+qPQ=", keyFile.getKey().getData()); }