public static String collectionAsCommaDelimitedString(Collection<?> col) {
        if (col == null || col.isEmpty()) {
            return "";
        }

        StringBuilder sb = new StringBuilder();
        Iterator<?> it = col.iterator();
        while (it.hasNext()) {
            sb.append(it.next().toString());
            if (it.hasNext()) {
                sb.append(",");
            }
        }

        return sb.toString();
    }
@Test
    public void testCollectionAsCommaDelimitedString() {
        assertEquals("Claus,Willem,Jonathan",
                CollectionHelper.collectionAsCommaDelimitedString(Arrays.asList("Claus", "Willem", "Jonathan")));

        assertEquals("", CollectionHelper.collectionAsCommaDelimitedString(null));

        assertEquals("Claus", CollectionHelper.collectionAsCommaDelimitedString(Collections.singletonList("Claus")));
    }