@Test
public void shouldHandleFloat() {

  Codec<Float> floatCodec = mapper.codecFor(primitive(FLOAT));
  assertThat(floatCodec).isSameAs(mapper.cfloat);
  encodeAndDecode(floatCodec, 0.0f, "0x00000000");
  encodeAndDecode(floatCodec, 86.765309f, "0x42ad87d7");
  encodeAndDecode(floatCodec, Float.MIN_VALUE, "0x00000001");
  encodeAndDecode(floatCodec, Float.MAX_VALUE, "0x7f7fffff");
  encodeAndDecode(floatCodec, null, null, 0.0f);
  encodeObjectAndDecode(floatCodec, 86.765309, "0x42ad87d7", 86.765309f);
  encodeObjectAndDecode(floatCodec, 86.765309f, "0x42ad87d7", 86.765309f);
  encodeObjectAndDecode(floatCodec, "86.765309", "0x42ad87d7", 86.765309f);
  encodeObjectAndDecode(floatCodec, null, null, 0.0f);
  encodeObjectAndDecode(floatCodec, Optional.of(12), null, 0.0f);
  try {
    // not enough bytes.
    floatCodec.decode(Bytes.fromHexString("0x00ff"));
  } catch (InvalidTypeException e) {
    // expected
  }
}