### Question:
StringUtil { public static String stripControlCharacters(Object value) { if (value == null) { return null; } return stripControlCharacters(value.toString()); } private  StringUtil(); static String stripControlCharacters(Object value); static String stripControlCharacters(String value); static String[] split(String value, char delim); static final String NEWLINE; }### Answer:
@Test public void stripControlCharactersObjectNull() { assertNull(StringUtil.stripControlCharacters(null)); }
@Test public void stripControlCharactersNull() { assertNull(StringUtil.stripControlCharacters(null)); }
@Test public void stripControlCharactersRightTrim() { final char controlCode = 0x0000; final String object = "abbb" + controlCode; assertEquals(5, object.length()); final String stripped = StringUtil.stripControlCharacters(object); assertFalse(object.equals(stripped)); assertEquals(4, stripped.length()); }
@Test public void stripControlCharactersLeftTrim() { final char controlCode = 0x0000; final String string = controlCode + "abbb"; assertEquals(5, string.length()); final String stripped = StringUtil.stripControlCharacters(string); assertFalse(string.equals(stripped)); assertEquals(4, stripped.length()); }
@Test public void stripControlCharacters() { for (char i = 0x0000; i <= 0x001F; i ++) { assertStripped(i); } for (char i = 0x007F; i <= 0x009F; i ++) { assertStripped(i); } }
@Test public void stripNonControlCharacter() { final char controlCode = 0x002F; final String string = controlCode + "abbb"; final String stripped = StringUtil.stripControlCharacters(string); assertEquals("The string should be unchanged", string, stripped); }