### Question:
StringUtils { public static String[] getTrimmedStrings(String str){ if (null == str || "".equals(str.trim())) { return emptyStringArray; } return str.trim().split("\\s*,\\s*"); }  static String stringifyException(Throwable e); static String simpleHostname(String fullHostname); @Deprecated static String humanReadableInt(long number); static String format(final String format, final Object... objects); static String formatPercent(double fraction, int decimalPlaces); static String arrayToString(String[] strs); static String byteToHexString(byte[] bytes, int start, int end); static String byteToHexString(byte bytes[]); static byte[] hexStringToByte(String hex); static String uriToString(URI[] uris); static URI[] stringToURI(String[] str); static Path[] stringToPath(String[] str); static String formatTimeDiff(long finishTime, long startTime); static String formatTime(long timeDiff); static String getFormattedTimeWithDiff(DateFormat dateFormat, 
                                                long finishTime, long startTime); static String[] getStrings(String str); static Collection<String> getStringCollection(String str); static Collection<String> getTrimmedStringCollection(String str); static String[] getTrimmedStrings(String str); static String[] split(String str); static String[] split(
      String str, char escapeChar, char separator); static String[] split(
      String str, char separator); static int findNext(String str, char separator, char escapeChar, 
                             int start, StringBuilder split); static String escapeString(String str); static String escapeString(
      String str, char escapeChar, char charToEscape); static String escapeString(String str, char escapeChar, 
                                    char[] charsToEscape); static String unEscapeString(String str); static String unEscapeString(
      String str, char escapeChar, char charToEscape); static String unEscapeString(String str, char escapeChar, 
                                      char[] charsToEscape); static void startupShutdownMessage(Class<?> clazz, String[] args,
                                     final org.apache.commons.logging.Log LOG); static String escapeHTML(String string); static String byteDesc(long len); @Deprecated static String limitDecimalTo2(double d); static String join(CharSequence separator, Iterable<?> strings); static String camelize(String s); static final int SHUTDOWN_HOOK_PRIORITY; final static String[] emptyStringArray; final static char COMMA; final static String COMMA_STR; final static char ESCAPE_CHAR; }### Answer:
@Test public void testGetTrimmedStrings() throws Exception { String compactDirList = "/spindle1/hdfs,/spindle2/hdfs,/spindle3/hdfs"; String spacedDirList = "/spindle1/hdfs, /spindle2/hdfs, /spindle3/hdfs"; String pathologicalDirList1 = " /spindle1/hdfs , /spindle2/hdfs ,/spindle3/hdfs "; String pathologicalDirList2 = " /spindle1/hdfs , /spindle2/hdfs ,/spindle3/hdfs , "; String emptyList1 = ""; String emptyList2 = " "; String[] expectedArray = {"/spindle1/hdfs", "/spindle2/hdfs", "/spindle3/hdfs"}; String[] emptyArray = {}; assertArrayEquals(expectedArray, StringUtils.getTrimmedStrings(compactDirList)); assertArrayEquals(expectedArray, StringUtils.getTrimmedStrings(spacedDirList)); assertArrayEquals(expectedArray, StringUtils.getTrimmedStrings(pathologicalDirList1)); assertArrayEquals(expectedArray, StringUtils.getTrimmedStrings(pathologicalDirList2)); assertArrayEquals(emptyArray, StringUtils.getTrimmedStrings(emptyList1)); assertArrayEquals(emptyArray, StringUtils.getTrimmedStrings(emptyList2)); }