### Question:
CollectionUtils { public static String toString(Collection<?> col) { if (isEmpty(col)) { return ""; } StringBuilder sb = new StringBuilder(); sb.append("["); for (Object obj : col) { sb.append(StringUtils.toString(obj)); sb.append(","); } sb.deleteCharAt(sb.length() - 1); sb.append("]"); return sb.toString(); } private  CollectionUtils(); static boolean isEmpty(Collection<?> col); static boolean isNotEmpty(Collection<?> col); static boolean isEmpty(Object[] array); static boolean isNotEmpty(Object[] array); static String toString(Collection<?> col); static boolean isSizeEquals(Collection<?> col0, Collection<?> col1); static String encodeMap(Map<String, String> map); static Map<String, String> decodeMap(String data); static List<String> toUpperList(List<String> sourceList);  }### Answer:
@Test public void testCollectionToString() { List<String> emptyCollection = new ArrayList<>(); List<String> filledCollection = new ArrayList<>(); filledCollection.add("Foo"); filledCollection.add("Bar"); Assertions.assertEquals("", CollectionUtils.toString(emptyCollection)); Assertions.assertEquals("[Foo,Bar]", CollectionUtils.toString(filledCollection)); }