CharUtils { public static boolean isUnreserved(char a) { return isAlphaNumeric(a) || a == '-' || a == '.' || a == '_' || a == '~'; } 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 testCharUtilsIsUnreserved() { char[] arr = { '-', '.', 'a', '9', 'Z', '_', 'f' }; for (char a : arr) { Assert.assertTrue(CharUtils.isUnreserved(a)); } char[] arr2 = { ' ', '!', '(', '\n' }; for (char a : arr2) { Assert.assertFalse(CharUtils.isUnreserved(a)); } }