### Question:
BytesValues { public static BigInteger asSignedBigInteger(BytesValue bytes) { if (bytes.size() == 0) { return BigInteger.ZERO; } return new BigInteger(bytes.getArrayUnsafe()); } private  BytesValues(); static int countZeros(BytesValue value); static BytesValue trimLeadingZeros(BytesValue value); static BytesValue toMinimalBytes(long l); static BytesValue ofUnsignedByte(int v); static BytesValue ofUnsignedShort(int v); static BytesValue ofUnsignedInt(long v); static BytesValue ofUnsignedIntLittleEndian(long v); static int extractInt(BytesValue value); static int extractIntLittleEndian(BytesValue value); static long extractLong(BytesValue value); static BytesValue concatenate(BytesValue... values); static BigInteger asUnsignedBigInteger(BytesValue bytes); static String asString(BytesValue bytes); static BigInteger asSignedBigInteger(BytesValue bytes); static BytesValue and(BytesValue b1, BytesValue b2); static BytesValue or(BytesValue b1, BytesValue b2);  }### Answer:
@Test public void signedBigInteger() { assertEquals(bi("0"), asSignedBigInteger(BytesValue.EMPTY)); assertEquals(bi("1"), asSignedBigInteger(BytesValue.of(1))); assertEquals(bi("-1"), asSignedBigInteger(h("0xFF"))); BigInteger expected = BigInteger.valueOf(2).pow(100).add(BigInteger.valueOf(Long.MAX_VALUE)); MutableBytesValue v = MutableBytesValue.create(13); v.set(0, (byte) 16); v.setLong(v.size() - 8, Long.MAX_VALUE); assertEquals(expected, asSignedBigInteger(v)); expected = expected.negate(); v = MutableBytesValue.create(13); v.set(0, (byte) 0xEF); for (int i = 1; i < 5; i++) v.set(i, (byte) 0xFF); v.set(5, (byte) 0x80); v.set(12, (byte) 1); assertEquals(expected, asSignedBigInteger(v)); }