### Question:
Util { public static byte[] hextobyte(String keyText) { if ((keyText.length() % 2) != 0) { throw new IllegalArgumentException("keyText cannot have odd length."); } byte[] bytes = new byte[keyText.length() / 2]; for (int index = 0; index < bytes.length; index++) { bytes[index] = parseSingleByte(keyText.charAt(2 * index), keyText.charAt(2 * index + 1)); } return bytes; } private  Util(); static byte[] hextobyte(String keyText); static String bytetohex(byte[] bytearray);  }### Answer:
@Test void testHexToByteWithOddLength() { assertThrows(IllegalArgumentException.class, () -> hextobyte("123")); }
@Test void testHexToByteWithInvalidCharacter() { assertThrows(IllegalArgumentException.class, () -> hextobyte("1G")); assertThrows(IllegalArgumentException.class, () -> hextobyte("1^")); assertThrows(IllegalArgumentException.class, () -> hextobyte("@%")); }
@Test void testHexToByteWithZeroLength() { assertArrayEquals(new byte[] {}, hextobyte("")); }
@Test void testHexToByte() { assertArrayEquals(new byte[] {1, -82, 34}, hextobyte("01aE22")); }