CollectionUtils { public static <T> String getCommaSeparated(T[] array) { StringBuilder ret = new StringBuilder(""); String separator = ""; for (T object : array) { ret.append(separator).append(object); separator = ", "; } return ret.toString(); } private  CollectionUtils(); static boolean contains(T[] collection, T testObject); static String getCommaSeparated(T[] array); static boolean contains(int[] array, int element); static int indexOf(T[] array, T element);  }
@Test public void testCommaSeparatedPrint() { Integer[] array = new Integer[] { 1, 12, 14 }; assertEquals("1, 12, 14", CollectionUtils.getCommaSeparated(array)); array = new Integer[] { }; assertEquals("", CollectionUtils.getCommaSeparated(array)); }