### Question:
Lang { public static String stringList(Object[] array, String separator) { if (array == null) return null; StringBuilder sb = new StringBuilder(); int oLen = array.length; for (int i = 0; i < oLen; i++) { sb.append(array[i] == null ? array[i] : array[i].toString()); if (i != (oLen - 1)) { sb.append(separator); } } return sb.toString(); }  static String RPAD(String str, int len); static String RPAD(String str, char c, int len); static String LPAD(String str, int len); static String LPAD(String str, char c, int len); static String truncate(String str, int len); static T NVL(T first, T second); static int linearSearch(Object[] oArray, Object obj); static int linearSearch(Iterable<?> oArray, Object obj); static boolean isInteger(String s); static boolean isDouble(String s); static String stringList(Object[] array, String separator); static String stringList(Iterable<?> array, String separator); static String dblStr(double x); static String milliStr(long milliseconds); static T setAtFill(List<T> list, int ndx, T item); static String getClasspath(); static void addPath(URLClassLoader urlClassLoader, URL u); static void loadedDependencies(String verboseclassOut); static String stackString(Throwable t); static String urlEncode(String preEncode); static String fullURLEncode(String preEncode); static String urlDecode(String encoded); static T error(Throwable t); static T deepCopy(T obj); static final String pWhite_Space; }### Answer:
@Test public void testStringListObjectArrayString() { String[] animals = {"Dog", "Cat", "Mouse", "Dog"}; String[] nullArray = null; assertEquals("Dog|Cat|Mouse|Dog", Lang.stringList(animals,"|")); assertEquals("", Lang.stringList(new String[]{""},"|")); assertEquals(null, Lang.stringList(nullArray,"|")); }
@Test public void testStringListIterableOfQString() { String[] animals = {"Dog", "Cat", "Mouse", "Dog"}; assertEquals("Dog|Cat|Mouse|Dog", Lang.stringList(Arrays.asList(animals),"|")); assertEquals("", Lang.stringList(Arrays.asList(new String[]{""}),"|")); }