### Question:
Profile { public JSONObject toJSONObject() { JSONObject jo = new JSONObject(); jo.put("executions", this.executions); jo.put("minTime", this.minTime); jo.put("avgTime", this.averageTime); jo.put("maxTime", this.maxTime); return jo; } Profile();  Profile(Profile p);  Profile(JSONObject json); void start(); void end(); long getExecutionCount(); long getStartTime(); long getMinExecutionTime(); long getAverageExecutionTime(); long getMaxExecutionTime(); void clearExecutionCount(); void setExecutions(long executions); void setMinTime(long minTime); void setMaxTime(long maxTime); void setAvgTime(long averageTime); void accumulate(P p); JSONObject toJSONObject(); JSONObject updateJSON(JSONObject jo); void accumulateJSON(JSONObject jo); Profile copy(); @Override String toString();  }### Answer:
@Test public void toJSONObjectTest() { Profile original = new Profile( new JSONObject("{" + "\"executions\":" + SET_EXECUTION_COUNT + "," + "\"maxTime\":" + SET_MAX_EXECUTION_TIME + "," + "\"minTime\":" + SET_MIN_EXECUTION_TIME + "," + "\"avgTime\":" + SET_AVG_EXECUTION_TIME + "}")); JSONObject jsonObject = original.toJSONObject(); Profile p = new Profile(jsonObject); if (p.getExecutionCount() != SET_EXECUTION_COUNT) { fail("Invalid execution count on complete JSON constructor"); } if (p.getMinExecutionTime() != SET_MIN_EXECUTION_TIME) { fail("Invalid default min execution time on complete JSON constructor"); } if (p.getAverageExecutionTime() != SET_AVG_EXECUTION_TIME) { fail("Invalid default average execution time on complete JSON constructor"); } if (p.getMaxExecutionTime() != SET_MAX_EXECUTION_TIME) { fail("Invalid default max execution time on complete JSON constructor"); } }