### Question:
CaptionJsonSerializer implements JsonSerializer<Caption> { public JSONObject serialize(Caption caption) throws JSONException { JSONObject data = new JSONObject(); if (caption.isDefaut() != null) { data.put("default", caption.isDefaut()); } return data; }  Caption deserialize(JSONObject response); List<Caption> deserialize(JSONArray data); JSONObject serialize(Caption caption);  }### Answer:
@Test public void serializeEmpty() throws JSONException { assertEquals(0, captionJsonSerializer.serialize(new Caption()).length()); }
@Test public void serialize() throws JSONException { Caption caption = new Caption(); caption.setDefaut(true); JSONObject jsonCaption = captionJsonSerializer.serialize(caption); assertTrue(jsonCaption.getBoolean("default")); }