### Question:
XmlCodec { static public <T> T decode(Class<T> clazz, URL url) throws IOException, XMLStreamException, JAXBException, SAXException { return decode(clazz, url, null); }  static T decode(Class<T> clazz, URL url); static T decode(Class<T> clazz, URL url, Properties props); static T decode(Class<T> clazz, InputStream is); static T decode(Class<T> clazz, InputStream is, Properties props); static T decode(Class<T> clazz, InputStream is, Properties props, ValidationEventHandler validationHandler); static void encode(Object in, OutputStream os, boolean format); volatile static JAXBContext _context; }### Answer:
@Test public void unmarshalling() throws Exception { BrokerDTO dto = XmlCodec.decode(BrokerDTO.class, resource("XmlCodecTest.xml")); assertNotNull(dto); assertEquals(1, dto.other.size()); VirtualHostDTO host = dto.virtual_hosts.get(0); assertEquals("vh-local", host.id); assertEquals("localhost", host.host_names.get(0)); assertEquals("example.com", host.host_names.get(1)); assertEquals("queue1", host.queues.get(0).id); assertEquals("topic1", host.topics.get(0).id); assertEquals("durable_subscription1", host.dsubs.get(0).id); AcceptingConnectorDTO connector = (AcceptingConnectorDTO)dto.connectors.get(0); assertNotNull(connector); }