CustomIcons { public List<CustomIcon> getIcons() { return customIconList; } CustomIcons();  CustomIcons(CustomIconsContract customIconsContract); List<CustomIcon> getIcons(); CustomIcon getIconByUuid(UUID uuid); @Override final int hashCode(); @Override final boolean equals(Object obj);  }
@Test public void shouldUnmarshallXmlToObject() throws Exception { UUID uuid = UUID.fromString("87d4f441-a5ec-4ce0-8ca9-82a5079d28ef"); CustomIcon customIcon = new CustomIconBuilder() .uuid(uuid) .data(new byte[10]) .build(); CustomIcons customIcons = new CustomIconsBuilder().addIcon(customIcon).build(); String xml = "<customIcons><Icon><UUID>h9T0QaXsTOCMqYKlB50o7w==</UUID><Data>AAAAAAAAAAAAAA==</Data></Icon></customIcons>"; ByteArrayInputStream inputStream = new ByteArrayInputStream(xml.getBytes()); CustomIcons customIconsUnmarshall = new SimpleXmlParser().fromXml(inputStream, new NullProtectionStrategy(), CustomIcons.class); Assert.assertEquals(customIcons.getIcons().size(), customIconsUnmarshall.getIcons().size()); Assert.assertArrayEquals(customIcons.getIcons().get(0).getData(), customIconsUnmarshall.getIcons().get(0).getData()); Assert.assertEquals(customIcons.getIcons().get(0).getUuid(), customIconsUnmarshall.getIcons().get(0).getUuid()); }