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.object();
jWriter.key("foo");
// Verify we can put a JSONObject into the stream!
JSONObject jObj = factory.createJSONObject();
jObj.put("foo", true);