AttachmentValue { public int getRef() { return ref; } AttachmentValue();  AttachmentValue(int ref); int getRef(); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }
@Test public void shouldUnmarshallXmlToObject() throws Exception { AttachmentValue attachmentValue = new AttachmentValue(3); String xml = "<Value Ref='3' />"; ByteArrayInputStream inputStream = new ByteArrayInputStream(xml.getBytes()); AttachmentValue attachmentValueUnmarshalled = new SimpleXmlParser().fromXml(inputStream, new NullProtectionStrategy(), AttachmentValue.class); Assert.assertEquals(attachmentValue.getRef(), attachmentValueUnmarshalled.getRef()); }