WordUtil { public static String removeSurrounding(final String token) { char[] chars = token.toCharArray(); if (surroundPairs.containsKey(chars[0])) { if (chars[chars.length - 1] == surroundPairs.get(chars[0])) { return token.substring(1, chars.length - 1); } } return token; }  static String removeSurrounding(final String token); static boolean isAlphaNumberic(String str); static boolean isMixedCase(String str); static boolean isUpperAlphaNumberic(String str); static boolean isAlphabetic(String str); static boolean hasVowel(String str); static boolean hasConsonant(String str); static boolean hasVowelAndConsonant(String str); static boolean hasCharacter(String str, String matchChars); static boolean hasTrailingCharacter(String str, String matchChars); static boolean hasTrailingPuncuation(String str); static int countLeadChar(String str, char matchChar); static boolean startsWithCharacter(String str, String matchChars); static String compactRepeatedChars(String str); static String toUnicode(String str); static String toDecimal(String str); static boolean hasNumber(String str); static boolean hasLetter(String str); static boolean hasCapital(String str); static boolean startsWithCapital(String str); static boolean hasAllCapitals(String str); static String getCapital(String seq); static String capitalize(String str, char[] wordDelimiters); static String capitalizeTitle(String str); static String capitalizeTitle(String str, char[] wordDelimiters); static boolean hasWord(String segment, Collection<String> stopwords); static boolean hasWord(String segment, String wordDelimiters, Collection<String> stopwords); static boolean hasWord(StringTokenizer tokenizer, Collection<String> stopwords); static boolean hasLeadWord(String segment, Collection<String> stopwords, boolean caseSensative); static boolean hasLeadWord(String segment, String wordDelimiters, Collection<String> stopwords,
			boolean caseSensative); static boolean hasLeadWord(StringTokenizer tokenizer, Collection<String> stopwords, boolean caseSensative); static int countWords(String segment, char[] wordDelimiters); static String initials(String segment); static String initials(String segment, char[] wordDelimiters); static String longestCommonSubstring(String word1, String word2);  }
@Test public void removeSurrounds() throws IOException { String expect = "AN"; assertEquals(expect, WordUtil.removeSurrounding("\u2018AN\u2019")); assertEquals(expect, WordUtil.removeSurrounding("(AN)")); assertEquals(expect, WordUtil.removeSurrounding("[AN]")); assertEquals(expect, WordUtil.removeSurrounding("{AN}")); assertEquals(expect, WordUtil.removeSurrounding("<AN>")); }