### Question:
JAXBDuration implements JAXBWrapper<Duration> { @Override public Duration getWrappedObject() { return Duration.create((Class<? extends Duration>)myUnits, myUnscaledMagnitude, myScale); } JAXBDuration(Duration dur); protected  JAXBDuration(); @Override boolean equals(Object obj); @Override Duration getWrappedObject(); @Override int hashCode(); void setDuration(Duration duration);  }### Answer:
@Test public void test() throws JAXBException, ClassNotFoundException { Duration result; Element el; Duration testSeconds = new Seconds(new BigDecimal("3324.352")); ByteArrayOutputStream baos = new ByteArrayOutputStream(); XMLUtilities.writeXMLObject(new JAXBDuration(testSeconds), baos); result = XMLUtilities.readXMLObject(new ByteArrayInputStream(baos.toByteArray()), JAXBDuration.class).getWrappedObject(); Assert.assertEquals(result, testSeconds); el = XMLUtilities.marshalJAXBableToElement(testSeconds); result = XMLUtilities.readJAXBableObject(el, Duration.class); Assert.assertEquals(result, testSeconds); Duration testMonths = new Months(new BigDecimal("3324.352")); baos.reset(); XMLUtilities.writeXMLObject(new JAXBDuration(testMonths), baos); result = XMLUtilities.readXMLObject(new ByteArrayInputStream(baos.toByteArray()), JAXBDuration.class).getWrappedObject(); Assert.assertEquals(result, testMonths); el = XMLUtilities.marshalJAXBableToElement(testMonths); result = XMLUtilities.readJAXBableObject(el, Duration.class); Assert.assertEquals(result, testMonths); }