### Question:
SafeSerdes { public static Serde<Long> Long() { final Serde<Long> serde = Serdes.Long(); return new Serdes.WrapperSerde<>( serde.serializer(), new SafeDeserializer<>(serde.deserializer(), Long.class) ); }  static Serde<T> serdeFrom(final Serde<T> serde, final T defaultValue); static Serde<T> serdeFrom(final Serializer<T> serializer,
                                         final Deserializer<T> deserializer,
                                         final T defaultValue); static Serde<T> serdeFrom(final Class<T> type, final T defaultValue); static Serde<String> String(); static Serde<String> String(final String defaultValue); static Serde<Long> Long(); static Serde<Long> Long(final Long defaultValue); static Serde<Double> Double(); static Serde<Double> Double(final Double defaultValue); static Serde<Integer> Integer(); static Serde<Float> Float(); static Serde<Float> Float(final Float defaultValue); static Serde<UUID> UUID(); static Serde<UUID> UUID(final UUID uuid);  }### Answer:
@Test public void shouldSafelyDeserializeLongValueGivenDefaultObject() { final Serde<Long> serde = SafeSerdes.Long(0L); final Deserializer<Long> deserializer = serde.deserializer(); final Serializer<Long> serializer = serde.serializer(); Assertions.assertEquals(0L, deserializer.deserialize(TOPIC, CORRUPTED_RECORD)); Assertions.assertEquals(2L, deserializer.deserialize(TOPIC, serializer.serialize(TOPIC, 2L))); }