### Question:
ChartOptions extends HashMap<String, Object> implements IClusterable, JavaScriptable, Jsonable { @Override public JSONObject toJSON() { return new ModelAwareJSONObject(this.getModelObjects()); } ChartOptions();  ChartOptions(String name);  ChartOptions(ChartOptions m);  ChartOptions(String name, Map<? extends String, ? extends Object> m); static ChartOptions fromJson(String json); static ChartOptions fromJson(JSONObject json); String getName(); void setName(String name); @Override boolean equals(Object obj); @Override int hashCode(); ChartOptions getModelObjects(); @Override String toJavaScript(); String toJavaScript(String varname); @Override JSONObject toJSON();  }### Answer:
@Test public void testToJSON() { ChartOptions instance = new ChartOptions(); instance.put("title", "Header"); JSONObject expResult = new JSONObject("{'title':'Header'}"); JSONObject result = instance.toJSON(); assertEquals(expResult.toString(), result.toString()); }