public static void main(String[] args) throws Exception { MyJSONObject o = new MyJSONObject("Person-1234", false); MyJSONObject r = new MyJSONObject("Person-1234", true); MyJSONObject f = new MyJSONObject("Person-2345", false); Array a = new Array(); a.add(f); a.add(3456); a.add(null); a.add(r); a.add(null); KVMap map = new KVMap(); map.put("k1", r); map.put("k2", f); map.put("k3", null); map.put("k4", 3456); map.put(null, 6789); f.set("name", "Mary"); f.set("age", 30); f.set("friend", r); o.set("name", "John"); o.set("age", 20); o.set("friend", f); o.set("friends", a); o.set("map", map); System.err.println(o); } }