### Question:
StringCleaner { public static String removeExtraSpaces(String text) { text = text.trim().replaceAll("\\s+", " "); return text; }  static String tokenizeURLs(String text); static String tokenizeSmileys(String text); static String removeExtraSpaces(String text); static String removeSymbols(String text); static String unifyTerminators(String text); static String removeAccents(String text); static String clear(String text);  }### Answer:
@Test public void testRemoveExtraSpaces() { logger.info("removeExtraSpaces"); String text = " test test test test test\n\n\n\r\n\r\r test\n"; String expResult = "test test test test test test"; String result = StringCleaner.removeExtraSpaces(text); assertEquals(expResult, result); }