### Question:
EventListTypeConverter implements JsonSerializer<EventList>, JsonDeserializer<EventList> { @Override public JsonElement serialize( EventList src, Type srcType, JsonSerializationContext context) { JsonObject combined = new JsonObject(); combined.add("version", new JsonPrimitive(1)); JsonArray events = new JsonArray(); for (Serializable s : src.events()) { JsonObject obj = new JsonObject(); obj.add("type", new JsonPrimitive(s.getClass().getCanonicalName())); obj.add("body", context.serialize(s)); events.add(obj); } combined.add("events", events); return combined; }  @Override JsonElement serialize(
	    EventList src,
	    Type srcType, JsonSerializationContext context); @Override EventList deserialize(JsonElement json, Type type, JsonDeserializationContext context);  }### Answer:
@Test public void testSerialize() { EventList el = createInstance(); String res = gson().toJson(el); assertEquals(res, EXPECTED_RESULT); }