### Question:
ChartOptions extends HashMap<String, Object> implements IClusterable, JavaScriptable, Jsonable { public static ChartOptions fromJson(String json) { return fromJson(new JSONObject(json)); } 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 testFromJson_String() { String json = "{'title':'Header'}"; ChartOptions expResult = new ChartOptions(); expResult.put("title", "Header"); ChartOptions result = ChartOptions.fromJson(json); assertEquals(expResult, result); }
@Test public void testFromJson_JSONObject() { JSONObject json = new JSONObject("{'title':'Header',hAxis: { ticks: [5,10,15,20] }}"); ChartOptions result = ChartOptions.fromJson(json); assertEquals("[5,10,15,20]", ((ChartOptions) result.get("hAxis")).get("ticks").toString()); }