CharUtils { public static boolean isHex(char a) { return (a >= '0' && a <= '9') || (a >= 'a' && a <= 'f') || (a >= 'A' && a <= 'F'); } private  CharUtils(); static boolean isHex(char a); static boolean isAlpha(char a); static boolean isNumeric(char a); static boolean isAlphaNumeric(char a); static boolean isUnreserved(char a); static boolean isDot(char a); static boolean isWhiteSpace(char a); static String[] splitByDot(String input);  }
@Test public void testCharUtilsIsHex() { char[] arr = { 'a', 'A', '0', '9' }; for (char a : arr) { Assert.assertTrue(CharUtils.isHex(a)); } char[] arr2 = { '~', ';', 'Z', 'g' }; for (char a : arr2) { Assert.assertFalse(CharUtils.isHex(a)); } }