### Question:
HexUtils { public static byte[] hexStringToByteArray(final String s) { int sizeInt = s.length() / 2; byte[] returnArray = new byte[sizeInt]; String byteVal; for (int i = 0; i < sizeInt; i++) { int index = 2 * i; byteVal = s.substring(index, index + 2); returnArray[i] = (byte) (Integer.parseInt(byteVal, HEX_BASIS)); } return returnArray; } private  HexUtils(); static byte[] hexStringToByteArray(final String s); static String byteArrayToHexString(final byte[] b); static Integer hexToInt(final String s); static byte[] subarray(final byte[] b, final int start, final int end); static byte[] leReverseByte(final byte[] in); static int leReverseInt(final byte[] in); static long bytesToLong(final byte[] bytes); static final int HEX_BASIS; static final int FF_BYTE; }### Answer:
@Test public void testHexStringToByteArray() { String s = "abcd1234"; byte[] target = {-85, -51, 18, 52}; byte[] b = HexUtils.hexStringToByteArray(s); Assert.assertEquals(b, target); }