obj.put("key3", "key3");
String[] keys = {"key1", "key3"};
JSONObject testObj = new JSONObject(obj, keys);
assertTrue(testObj.size() == 2);
assertTrue(testObj.opt("key2") == null);
assertTrue(testObj.opt("key3").equals("key3"));
assertTrue(testObj.opt("key1").equals("key1"));
}
catch (JSONException jex) {
jex.printStackTrace();
assertTrue(false);