### Question:
EventListTypeConverter implements JsonSerializer<EventList>, JsonDeserializer<EventList> { @Override public EventList deserialize(JsonElement json, Type type, JsonDeserializationContext context) throws JsonParseException { JsonObject obj = json.getAsJsonObject(); Integer version = obj.getAsJsonPrimitive("version").getAsInt(); if (version != 1) throw new JsonParseException("Unable to parse event of version " + version); Iterator<JsonElement> eit = obj.getAsJsonArray("events").iterator(); List<Serializable> eventlist = new ArrayList<>(); while (eit.hasNext()) { String clazz = null; try { JsonObject elem = eit.next().getAsJsonObject(); clazz = elem.getAsJsonPrimitive("type").getAsString(); Class<? extends Serializable> eventClass = (Class<? extends Serializable>) Class.forName(clazz); Serializable s = context.deserialize(elem.get("body"), eventClass); eventlist.add(s); } catch (ClassNotFoundException e) { throw new JsonParseException("Cannot deserialize events of class " + clazz, e); } } return new EventList(eventlist); }  @Override JsonElement serialize(
	    EventList src,
	    Type srcType, JsonSerializationContext context); @Override EventList deserialize(JsonElement json, Type type, JsonDeserializationContext context);  }### Answer:
@Test public void testDeserialize() { EventList el = gson().fromJson(EXPECTED_RESULT, EventList.class); List<? extends Serializable> events = el.events(); assertEquals(events.get(0), 12345); assertEquals(events.get(1), "Hello, World!"); }