### Question:
TextUtil { public static byte[] hex2Bytes(String inHex) { if (inHex == null) return new byte[0]; inHex = inHex.replace(" ", ""); int hexlen = inHex.length(); if (hexlen % 2 == 1) { hexlen++; inHex = "0" + inHex; } byte[] result = new byte[(hexlen / 2)]; int j = 0; for (int i = 0; i < hexlen; i += 2) { result[j] = (byte) Integer.parseInt(inHex.substring(i, i + 2),16); j++; } return result; }  static boolean isEmpty(String text); static String MD5(String content); static String SHA1(String content); static String SHA224(String content); static String SHA256(String content); static String SHA384(String content); static String SHA512(String content); static byte[] digest(byte[] data, String algorithm); static String HmacMD5(String content, String key); static String HmacSHA1(String content, String key); static String HmacSHA224(String content, String key); static String HmacSHA256(String content, String key); static String HmacSHA384(String content, String key); static String HmacSHA512(String content, String key); static byte[] Hmac(byte[] data, String algorithm, byte[] key); static String encodeURL(String data, String enc); static String decodeURL(String data, String enc); static String string2Unicode(String string); static String unicode2String(String unicode); static String formetByteLength(long size); static String money2Chinese(double money); static String money2ChineseTraditional(double money); static String number2Chinese(long number); static String bytes2Hex(byte... bytes); static String bytes2Hex(byte[] bytes, boolean space); static byte[] hex2Bytes(String inHex); static String encodeBase64(byte[] content); static byte[] decodeBase64(String content);  }### Answer:
@Test public void hex2Bytes() { assertEquals("TEST", new String(TextUtil.hex2Bytes("54455354"))); assertEquals("TEST", new String(TextUtil.hex2Bytes("54 45 53 54"))); }