### Question:
StringUtils { public static String replaceFileNamesInvalidCharacters(String str) { if (str != null) { String endWhiteSpase = str.replaceAll(END_WHITESPACE, SUBSTITUTE_CHAR); String trimStr = endWhiteSpase.trim(); return trimStr.replaceAll(FILENAME_INVALID_CHARACTER_PATTERN, SUBSTITUTE_CHAR); } else { return null; } }  static String join(String separator, String... parts); static String[] toStringArray(Object... args); static Set<String> split(String aSource, String aDelimiter); static String replaceUnsupportedSymbols(String str); static String replaceFileNamesInvalidCharacters(String str); static Integer parseInt(String str, Integer defaultValue); static String formatDouble(double aValue); static String capitalize(String aValue); static String readReader(Reader aReader, int length);  }### Answer:
@Test public void testReplaceUnsupportedFileNamesSymbols() { System.out.println("replaceUnsupportedFileNamesSymbols"); String str = "test"; String expResult = "test"; String result = StringUtils.replaceFileNamesInvalidCharacters(str); assertEquals(expResult, result); str = " test"; expResult = "test"; result = StringUtils.replaceFileNamesInvalidCharacters(str); assertEquals(expResult, result); str = "te st"; expResult = "te st"; result = StringUtils.replaceFileNamesInvalidCharacters(str); assertEquals(expResult, result); str = " test "; expResult = "test__"; result = StringUtils.replaceFileNamesInvalidCharacters(str); assertEquals(expResult, result); }