try{
StringWriter w = new StringWriter();
System.setProperty("org.apache.wink.common.model.json.factory.impl", "org.apache.wink.json4j.compat.impl.ApacheJSONFactory");
JSONFactory factory = JSONFactory.newInstance();
JSONWriter jWriter = factory.createJSONWriter(w);
jWriter.array();
jWriter.endArray();
String str = w.toString();
// Verify it parses.
JSONArray test = factory.createJSONArray(str);
assertTrue(str.equals("[]"));