### Question:
DateSerializer implements JsonSerializer<Date> { @Override public JsonElement serialize(final Date src, final Type typeOfSrc, final JsonSerializationContext context) { return src == null ? new JsonPrimitive(StringUtils.EMPTY) : context.serialize(new DateTime(src.getTime()), DateTime.class); }  @Override JsonElement serialize(final Date src, final Type typeOfSrc, final JsonSerializationContext context);  }### Answer:
@Test(dataProvider = "serializeDP") public void serialize(Date date, String expectedOutput) { assertEquals(testling.serialize(date, Date.class, jsonSerializationContext).toString(), expectedOutput); verify(jsonSerializationContext, times(date != null ? 1 : 0)).serialize(any(), eq(DateTime.class)); }