### Question:
LiveStreamJsonSerializer implements JsonSerializer<LiveStream> { public JSONObject serialize(LiveStream liveStream) throws JSONException { JSONObject data = new JSONObject(); if (liveStream.getName() != null) { data.put("name", liveStream.getName()); } if (liveStream.isRecord() != null) { data.put("record", liveStream.isRecord()); } if (liveStream.getPlayerId() != null) { data.put("playerId", liveStream.getPlayerId()); } return data; }  LiveStream deserialize(JSONObject response); List<LiveStream> deserialize(JSONArray data); JSONObject serialize(LiveStream liveStream);  }### Answer:
@Test public void serialize() throws JSONException { LiveStream liveStream = new LiveStream(); liveStream.setName("name"); JSONObject jsonLive = liveJsonSerializer.serialize(liveStream); assertEquals("name", jsonLive.getString("name")); }