    @Test
    void testAsInteger() {

        assertThrows(RpcValueException.class, plainStringValue::asInteger);
        assertEquals(new BigInteger("0102030405", 16), bytesValue.asInteger());
        assertEquals(new BigInteger("1234"), oddIntegerValue.asInteger());
        assertEquals(new BigInteger("61731"), evenIntegerValue.asInteger());
        assertEquals(new BigInteger("1"), booleanValue.asInteger());

        RpcValue minusHex = new RpcValue("-0x4d2");
        assertEquals(new BigInteger("-1234"), minusHex.asInteger());

        RpcValue plusHex = new RpcValue("+0x4d2");
        assertThrows(RpcValueException.class, plusHex::asInteger);
    }