PluginUtils { public static int hexDigitToInt(char ch) { if (ch >= '0' && ch <= '9') { return ch - '0'; } else if (ch >= 'a' && ch <= 'f') { return ch - 'a' + 10; } else if (ch >= 'A' && ch <= 'F') { return ch - 'A' + 10; } return -1; } private  PluginUtils(); static int hexDigitToInt(char ch); static String escapeScriptTags(String str); static void escapeHtml(String str, StringBuilder buf); static void escapeHtmlAttribute(String str, StringBuilder buf); static String formatMoney(Decimal input, Locale locale); static String formatMoney(Decimal amount, String currencyCode, CLDR cldr); static String removeTags(String str); static String slugify(String value); static String truncate(String value, int maxLen, String ellipses); static void leftPad(long value, char padChar, int maxDigits, StringBuilder buf);  }
@Test public void testHexDigitToInt() { for (int i = 0; i < HEX_DIGIT.length; i++) { assertEquals(PluginUtils.hexDigitToInt(HEX_DIGIT[i]), i); assertEquals(PluginUtils.hexDigitToInt(Character.toUpperCase(HEX_DIGIT[i])), i); } assertEquals(PluginUtils.hexDigitToInt('x'), -1); assertEquals(PluginUtils.hexDigitToInt('Y'), -1); assertEquals(PluginUtils.hexDigitToInt('-'), -1); }