XMLIntrospector introspector = new XMLIntrospector();
introspector.register(new InputSource(new StringReader(MAPPING)));
ElementDescriptor descriptor = introspector.introspect(Element.class).getElementDescriptor();
ElementMapping elementMapping = new ElementMapping();
elementMapping.setAttributes(new AttributesImpl());
elementMapping.setName("Bogus");
elementMapping.setDescriptor(descriptor);
elementMapping.setType(Iterator.class);
ReadContext readContext = new ReadContext(new BindingConfiguration(), new ReadConfiguration());
assertNull(introspector.getPolymorphicReferenceResolver().resolveType(elementMapping, readContext));
elementMapping.setName("elementA");
Class resolution = introspector.getPolymorphicReferenceResolver().resolveType(elementMapping, readContext);
assertEquals("Should resolve to the element about", ElementA.class, resolution);
}