// Deserialization approach 2: use an Axiom tree with caching. In this case the
// XMLStreamReader implementation is OMStAXWrapper and we test interoperability
// between ADB and Axiom's OMStAXWrapper.
private static void testSerializeDeserializeUsingOMStAXWrapper(Object bean, Object expectedResult) throws Exception {
OMElement omElement = ADBBeanUtil.getOMElement(bean);
String omElementString = omElement.toStringWithConsume();
OMElement omElement2 = OMXMLBuilderFactory.createOMBuilder(
new StringReader(omElementString)).getDocumentElement();
assertBeanEquals(expectedResult, ADBBeanUtil.parse(bean.getClass(), omElement2.getXMLStreamReader()));
}