XmlHelper { @SuppressWarnings("unchecked") public <T> T unmarshallXmlToObject(Class<T> classType, String xmlString) throws JAXBException { JAXBContext context = JAXBContext.newInstance(classType); Unmarshaller un = context.createUnmarshaller(); return (T) un.unmarshal(IOUtils.toInputStream(xmlString)); }  String objectToXml(Object obj); String objectToXml(Object obj, boolean formatted); @SuppressWarnings("unchecked") T unmarshallXmlToObject(Class<T> classType, String xmlString);  }
@Test public void testUnmarshallXmlToObject() throws Exception { assertEquals(getTestBuildInformation(), xmlHelper.unmarshallXmlToObject(BuildInformation.class, getTestXml())); }