@Test
public void shouldHandleVarint() {

  Codec<BigInteger> varintCodec = mapper.codecFor(primitive(VARINT));
  assertThat(varintCodec).isSameAs(mapper.varint);
  BigInteger bigInt = new BigInteger("8574747744773434", 10);
  String bigIntStr = "0x1e76b0095da53a";
  encodeAndDecode(varintCodec, BigInteger.ZERO, "0x00");
  encodeAndDecode(varintCodec, bigInt, bigIntStr);
  encodeAndDecode(varintCodec, null, null);
  encodeObjectAndDecode(varintCodec, bigInt, bigIntStr, bigInt);
  encodeObjectAndDecode(varintCodec, "8574747744773434", bigIntStr, bigInt);
  encodeObjectAndDecode(varintCodec, 8577, "0x2181", BigInteger.valueOf(8577));
  encodeObjectAndDecode(varintCodec, null, null, null);
  encodeObjectAndDecode(varintCodec, Optional.of(12), null, null);
}