### Question:
ArrayUtils { public static BigInteger toBigInteger(final byte[] bytes) { final byte[] bigEndianBytes = new byte[bytes.length + 1]; for (int i = 0; i < bytes.length; ++i) { bigEndianBytes[i + 1] = bytes[bytes.length - i - 1]; } return new BigInteger(bigEndianBytes); } private  ArrayUtils(); static byte[] duplicate(final byte[] src); static byte[] concat(final byte[]... arrays); static byte[][] split(final byte[] bytes, final int splitIndex); static byte[] toByteArray(final BigInteger value, final int numBytes); static BigInteger toBigInteger(final byte[] bytes); static int isEqualConstantTime(final byte[] b, final byte[] c); static int compare(final byte[] b, final byte[] c); static int getBit(final byte[] h, final int i);  }### Answer:
@Test public void canConvertByteArrayToPositiveBigInteger() { final BigInteger result = ArrayUtils.toBigInteger(new byte[] {(byte) 0x95, 0x14, 0x32}); MatcherAssert.assertThat(new BigInteger("321495", 16), IsEqual.equalTo(result)); }
@Test public void canConvertByteArrayToNegativeBigInteger() { final BigInteger result = ArrayUtils.toBigInteger(new byte[] {(byte) 0x95, 0x14, (byte) 0xF2}); MatcherAssert.assertThat(new BigInteger("F21495", 16), IsEqual.equalTo(result)); }
@Test public void canConvertByteArrayWithLeadingZerosToBigInteger() { final BigInteger result = ArrayUtils.toBigInteger(new byte[] {(byte) 0xA5, 0x00, 0x00}); MatcherAssert.assertThat(new BigInteger("0000A5", 16), IsEqual.equalTo(result)); }