{
JacksonXMLProvider prov = new JacksonXMLProvider();
ByteArrayOutputStream out = new ByteArrayOutputStream();
Bean bean = new Bean();
Method m = getClass().getDeclaredMethod("writeConfig");
JacksonFeatures feats = m.getAnnotation(JacksonFeatures.class);
assertNotNull(feats); // just a sanity check
// when (extra) wrapping enabled, we get:
prov.writeTo(bean, bean.getClass(), bean.getClass(), new Annotation[] { feats },
MediaType.APPLICATION_JSON_TYPE, null, out);