// XmlObject to XMLStreamReader
XmlObject2XMLStreamReader t1 = new XmlObject2XMLStreamReader();
XMLStreamReader reader = t1.transform(object, null);
DataType targetDataType = new DataType<Class>(Object.class, null);
targetDataType.setMetadata(JAXBContextHelper.JAXB_CONTEXT_PATH, contextPath);
TransformationContext tContext = createMock(TransformationContext.class);
expect(tContext.getTargetDataType()).andReturn(targetDataType).anyTimes();
replay(tContext);
// XMLStreamReader to JAXB
XMLStreamReader2JAXB t2 = new XMLStreamReader2JAXB();
Object object2 = t2.transform(reader, tContext);
DataType sourceDataType = new DataType<Class>(Object.class, null);
sourceDataType.setMetadata(JAXBContextHelper.JAXB_CONTEXT_PATH, contextPath);
TransformationContext tContext1 = createMock(TransformationContext.class);
expect(tContext1.getSourceDataType()).andReturn(sourceDataType).anyTimes();
replay(tContext1);