public static String encodeQuantity(BigInteger value) {
        if (value.signum() != -1) {
            return HEX_PREFIX + value.toString(16);
        } else {
            throw new MessageEncodingException("Negative values are not supported");
        }
    }
@Test
    public void testQuantityEncodeNegative() {

        assertThrows(
                MessageEncodingException.class,
                () -> Numeric.encodeQuantity(BigInteger.valueOf(-1)));
    }