### Question:
NumericUtil { public static BigInteger hexToBigInteger(String hexValue) { String cleanValue = cleanHexPrefix(hexValue); return new BigInteger(cleanValue, 16); }  static byte[] generateRandomBytes(int size); static boolean isValidHex(String value); static String cleanHexPrefix(String input); static String prependHexPrefix(String input); static BigInteger bytesToBigInteger(byte[] value, int offset, int length); static BigInteger bytesToBigInteger(byte[] value); static BigInteger hexToBigInteger(String hexValue); static String bigIntegerToHex(BigInteger value); static String bigIntegerToHexWithZeroPadded(BigInteger value, int size); static byte[] bigIntegerToBytesWithZeroPadded(BigInteger value, int length); static byte[] hexToBytes(String input); static byte[] hexToBytesLittleEndian(String input); static byte[] reverseBytes(byte[] bytes); static String bytesToHex(byte[] input); static String beBigEndianHex(String hex); static String beLittleEndianHex(String hex); static int bytesToInt(byte[] bytes); static byte[] intToBytes(int intValue);  }### Answer:
@Test public void testHexToBigInteger() { String bigNumHex = "0x1010101010101010101010101010101010101010101010101010101010101010101010101010101"; String bigNum = "8376419748709451303509889043802165155304723617084912823321731795381253826590747254992008184065"; String smallNumHex = "0x10101"; String smallNumHexWithout0x = "10101"; String smallNum = "65793"; assertTrue(new BigInteger(bigNum).compareTo(NumericUtil.hexToBigInteger(bigNumHex)) == 0); assertTrue(new BigInteger(smallNum).compareTo(NumericUtil.hexToBigInteger(smallNumHex)) == 0); assertTrue(new BigInteger(smallNum).compareTo(NumericUtil.hexToBigInteger(smallNumHexWithout0x)) == 0); }
@Test public void testBigIntToHexStringNoPrefix() { String bigNumHex = "1010101010101010101010101010101010101010101010101010101010101010101010101010101"; String bigNum = "8376419748709451303509889043802165155304723617084912823321731795381253826590747254992008184065"; String smallNumHex = "10101"; String smallNum = "65793"; assertTrue(new BigInteger(smallNum).compareTo(NumericUtil.hexToBigInteger(smallNumHex)) == 0); assertTrue(new BigInteger(bigNum).compareTo(NumericUtil.hexToBigInteger(bigNumHex)) == 0); }