### Question:
FactKafkaSerializer implements Serializer<FactSEB> { @Override public byte[] serialize(String topic, FactSEB data) { try { return WRITER.writeValueAsBytes(data); } catch (JsonProcessingException ex) { LOGGER.error(ex, "Failed to serialize FactSEB."); throw new UncheckedIOException("Failed to serialize FactSEB.", ex); } }  @Override void configure(Map<String, ?> configs, boolean isKey); @Override byte[] serialize(String topic, FactSEB data); @Override void close();  }### Answer:
@Test public void testSerializeNull() throws Exception { assertNull(READER.<FactSEB>readValue(serializer.serialize("test", null))); }
@Test public void testSerializeObject() throws Exception { FactSEB expected = FactSEB.builder() .setId(UUID.randomUUID()) .build(); FactSEB actual = READER.readValue(serializer.serialize("test", expected)); assertNotNull(actual); assertEquals(expected.getId(), actual.getId()); }