### Question:
TermUtil { static public String trimPunctuation(String string){ int begin = 0; int end = string.length(); while(begin < end){ char c = string.charAt(begin); if(!isPunctuation(c)){ break; } begin++; } while(end > begin){ char c = string.charAt(end - 1); if(!isPunctuation(c)){ break; } end--; } if(begin > 0 || end < string.length()){ string = string.substring(begin, end); } return string; } private  TermUtil(); static String trimPunctuation(String string); static boolean isPunctuation(char c);  }### Answer:
@Test public void trimPunctuation(){ assertEquals("", TermUtil.trimPunctuation("")); assertEquals("", TermUtil.trimPunctuation("?")); assertEquals("", TermUtil.trimPunctuation("\u00BF?")); assertEquals("one", TermUtil.trimPunctuation("one")); assertEquals("one", TermUtil.trimPunctuation("one?")); assertEquals("one", TermUtil.trimPunctuation("\u00BFone?")); }