}
public synchronized void allBeansTest(JSONJAXBContext context, Collection<Object> beans) throws Exception {
JSONMarshaller marshaller = context.createJSONMarshaller();
JSONUnmarshaller unmarshaller = context.createJSONUnmarshaller();
for (Object originalBean : beans) {
printAsXml(originalBean);
StringWriter sWriter = new StringWriter();
marshaller.marshallToJSON(originalBean, sWriter);
System.out.println(sWriter.toString());
assertEquals(originalBean, unmarshaller.unmarshalFromJSON(new StringReader(sWriter.toString()), originalBean.getClass()));
}
}