StringWriter resultWriter = new StringWriter();
JsonFactory jsonFactory = new JsonFactory();
JsonGenerator jsonGenerator = jsonFactory.createJsonGenerator(resultWriter);
final Stax2JacksonWriter writer = configuration != null
? new Stax2JacksonWriter(jsonGenerator, configuration, clazz, jaxbContext) : new Stax2JacksonWriter(jsonGenerator, clazz, jaxbContext);
marshaller.marshal(jaxbBean, writer);
System.out.println(String.format("Marshalled: %s", resultWriter.toString()));
assertEquals("MISMATCH:\n" + expectedJsonExpr + "\n" + resultWriter.toString() + "\n",
normalizeJsonString(expectedJsonExpr), normalizeJsonString(resultWriter.toString()));