public class AnotherArrayTest extends TestCase {
public void testAnotherSimpleXmlTypeBean() throws Exception {
final JSONJAXBContext ctx = new JSONJAXBContext(JSONConfiguration.mapped().arrays("cats").build(), AnotherArrayTestBean.class);
final JSONMarshaller jm = ctx.createJSONMarshaller();
final StringWriter sw = new StringWriter();
AnotherArrayTestBean one = new AnotherArrayTestBean();
Cat c1 = new Cat("Foo", "Kitty");
one.addCat(c1);
Cat c2 = new Cat("Bar", "Puss");
one.addCat(c2);
one.setProp("testProp");
jm.marshallToJSON(one, sw);
String jsonResult = sw.toString();
System.out.println(jsonResult);
String excpectedResult = "{\"cats\":[{\"name\":\"Foo\",\"nickName\":\"Kitty\"},{\"name\":\"Bar\",\"nickName\":\"Puss\"}],\"prop\":\"testProp\"}";
assertEquals(excpectedResult, jsonResult);