### Question:
SafeSerdes { public static Serde<Double> Double() { final Serde<Double> serde = Serdes.Double(); return new Serdes.WrapperSerde<>( serde.serializer(), new SafeDeserializer<>(serde.deserializer(), Double.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 shouldSafelyDeserializeDoubleValueGivenDefaultObject() { final Serde<Double> serde = SafeSerdes.Double(0.0); final Deserializer<Double> deserializer = serde.deserializer(); final Serializer<Double> serializer = serde.serializer(); Assertions.assertEquals(0.0, deserializer.deserialize(TOPIC, CORRUPTED_RECORD)); Assertions.assertEquals(2.0, deserializer.deserialize(TOPIC, serializer.serialize(TOPIC, 2.0))); }