TargetData extends CObject { public JSONObject getJsonObjectAtIdx(final String type, final int index) { JSONObject rtn = null; final List<JSONObject> temp = getCollectionTypeData().get(type); if (temp != null && index >= 0 && index < getNumJsonObject(type)) { rtn = temp.get(index); } return rtn; } TargetData(final JSONArray jsonArr); JSONObject getJsonObjectAtIdx(final String type, final int index); int getNumJsonObject(final String type);  }
@Test public void getJsonObjectAtIdx_Foobar0_ShouldReturnNull() { assert (td.getJsonObjectAtIdx("foobar", 0) == null); }
@Test public void getJsonObjectAtIdx_Functions10_ShouldReturnNull() { assert (td.getJsonObjectAtIdx("functions", 10) == null); }
@Test public void getJsonObjectAtIdx_Functions0_ShouldReturnJsonObject() { assert (td.getJsonObjectAtIdx("functions", 0) instanceof JSONObject); }