### Question:
StringUtils { public static String normalizeWS(String value) { char[] tmp = new char[value.length()]; int pos = 0; boolean prevws = false; for (int ix = 0; ix < tmp.length; ix++) { char ch = value.charAt(ix); if (ch != ' ' && ch != '\t' && ch != '\n' && ch != '\r') { if (prevws && pos != 0) tmp[pos++] = ' '; tmp[pos++] = ch; prevws = false; } else prevws = true; } return new String(tmp, 0, pos); }  static String replaceAnyOf(String value, String chars,
                                    char replacement); static String normalizeWS(String value); static String[] split(String str); static String join(String[] pieces);  }### Answer:
@Test public void testEmptyWS() { assertEquals("", StringUtils.normalizeWS("")); }
@Test public void testNoWS() { assertEquals("abc", StringUtils.normalizeWS("abc")); }
@Test public void testLeadingWS() { assertEquals("abc", StringUtils.normalizeWS(" abc")); }
@Test public void testTrailingWS1() { assertEquals("abc", StringUtils.normalizeWS("abc ")); }
@Test public void testTrailingWS2() { assertEquals("abc", StringUtils.normalizeWS("abc ")); }
@Test public void testTrailingWS3() { assertEquals("abc def", StringUtils.normalizeWS("abc def ")); }