@Test
public void shouldHandleBigint() {

  Codec<Long> bigintCodec = mapper.codecFor(primitive(BIGINT));
  assertThat(bigintCodec).isSameAs(mapper.bigint);
  encodeAndDecode(bigintCodec, 0L, "0x0000000000000000");
  encodeAndDecode(bigintCodec, 1L, "0x0000000000000001");
  encodeAndDecode(bigintCodec, Long.MIN_VALUE, "0x8000000000000000");
  encodeAndDecode(bigintCodec, Long.MAX_VALUE, "0x7fffffffffffffff");
  encodeAndDecode(bigintCodec, null, null, 0L);
  encodeObjectAndDecode(bigintCodec, null, null, 0L);
  encodeObjectAndDecode(bigintCodec, 7L, "0x0000000000000007", 7L);
  encodeObjectAndDecode(bigintCodec, 7, "0x0000000000000007", 7L);
  encodeObjectAndDecode(bigintCodec, "7", "0x0000000000000007", 7L);
  encodeObjectAndDecode(bigintCodec, Optional.of(12), null, 0L);
  try {
    // not enough bytes.
    bigintCodec.decode(Bytes.fromHexString("0x00ff"));
  } catch (InvalidTypeException e) {
    // expected
  }
}