### Question:
StringUtils { public static String trimSpaces (String original) { return original.replaceFirst("^\\s*(.*?)\\s*$", "$1"); } private  StringUtils(); static String addQuotesIfNecessary(String string); static String generateRandomString(int length); static String convertCamelCaseToSentence(String camelCase); static String trimSpaces(String original);  }### Answer:
@Test public void trimSpaces () { assertEquals("short", StringUtils.trimSpaces(" short ")); assertEquals("short", StringUtils.trimSpaces("short ")); assertEquals("short", StringUtils.trimSpaces(" short")); assertEquals("longer sentence", StringUtils.trimSpaces(" longer sentence ")); assertEquals("longer sentence", StringUtils.trimSpaces(" longer sentence")); assertEquals("longer sentence", StringUtils.trimSpaces("longer sentence ")); }