@Test
public void shouldHandleTime() throws Exception {

  Codec<Long> timeCodec = mapper.codecFor(primitive(TIME));
  assertThat(timeCodec).isSameAs(mapper.time);
  encodeAndDecode(timeCodec, 0L, "0x0000000000000000");
  encodeAndDecode(timeCodec, 1L, "0x0000000000000001");
  encodeAndDecode(timeCodec, Long.MIN_VALUE, "0x8000000000000000");
  encodeAndDecode(timeCodec, Long.MAX_VALUE, "0x7fffffffffffffff");
  encodeAndDecode(timeCodec, null, null, 0L);
  encodeObjectAndDecode(timeCodec, null, null, 0L);
  encodeObjectAndDecode(timeCodec, 7L, "0x0000000000000007", 7L);
  encodeObjectAndDecode(timeCodec, 7, "0x0000000000000007", 7L);
  encodeObjectAndDecode(timeCodec, "7", "0x0000000000000007", 7L);
  encodeObjectAndDecode(timeCodec, Optional.of(12), null, 0L);
}