Code example for JSONObject

0
    interface TestOpenGraphObject extends GraphObject { 
        TestOpenGraphObjectData getData(); 
    } 
 
    public OpenGraphObject getParsedObject() throws JSONException {
        JSONObject jsonObject = new JSONObject(OBJECT_JSON);
        return GraphObject.Factory.create(jsonObject, OpenGraphObject.class);
    } 
 
    @SmallTest 
    @MediumTest 
    @LargeTest 
    public void testParsedId() throws JSONException { 
        OpenGraphObject parsedObject = getParsedObject();
        assertEquals("509", parsedObject.getId());
    } 
 
    @SmallTest 
    @MediumTest 
    @LargeTest 
    public void testParsedType() throws JSONException {