PropertyValue { public String getValue() { return value; } PropertyValue();  PropertyValue(boolean isProtected, String value); String getValue(); boolean isProtected(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }
@Test public void shouldUnmarshallXmlToObject() throws Exception { PropertyValue propertyValue = new PropertyValue(false, "TestValue"); String xml = "<propertyValue Protected='False'>TestValue</propertyValue>"; ByteArrayInputStream inputStream = new ByteArrayInputStream(xml.getBytes()); PropertyValue propertyValueUnmarshalled = new SimpleXmlParser().fromXml(inputStream, new NullProtectionStrategy(), PropertyValue.class); Assert.assertEquals(propertyValue.getValue(), propertyValueUnmarshalled.getValue()); }