@Test
public void testQuantityEncode() {

    assertThat(Numeric.encodeQuantity(BigInteger.valueOf(0)), is("0x0"));
    assertThat(Numeric.encodeQuantity(BigInteger.valueOf(1)), is("0x1"));
    assertThat(Numeric.encodeQuantity(BigInteger.valueOf(1024)), is("0x400"));
    assertThat(Numeric.encodeQuantity(
            BigInteger.valueOf(Long.MAX_VALUE)), is("0x7fffffffffffffff"));
    assertThat(Numeric.encodeQuantity(
            new BigInteger("204516877000845695339750056077105398031")),
            is("0x99dc848b94efc27edfad28def049810f"));
}