### Question:
TimestampSerializer extends JsonSerializer<Long> { @Override public void serialize(Long value, JsonGenerator gen, SerializerProvider serializers) throws IOException { gen.writeString(Instant.ofEpochMilli(value).toString()); }  @Override void serialize(Long value, JsonGenerator gen, SerializerProvider serializers);  }### Answer:
@Test public void testSerializeTimestamp() throws IOException { JsonGenerator generator = mock(JsonGenerator.class); TimestampSerializer serializer = new TimestampSerializer(); serializer.serialize(1480520820000L, generator, null); verify(generator, times(1)).writeString(eq("2016-11-30T15:47:00Z")); }