public static String toString(final Collection<?> col) {
        if (col == null) {
            return "null";
        }
        if (col.isEmpty()) {
            return "[]";
        }

        return CycleDependencyHandler.wrap(col, o -> {
            StringBuilder sb = new StringBuilder(32);
            sb.append("[");
            for (Object obj : col) {
                if (sb.length() > 1) {
                    sb.append(", ");
                }
                if (obj == col) {
                    sb.append("(this ").append(obj.getClass().getSimpleName()).append(")");
                } else {
                    sb.append(StringUtils.toString(obj));
                }
            }
            sb.append("]");
            return sb.toString();
        });
    }
@Test
    public void testCollectionToString() {
        List<String> nullCollection = null;
        List<String> emptyCollection = new ArrayList<>();
        List<Object> filledCollection = new ArrayList<>();

        filledCollection.add("Foo");
        filledCollection.add("Bar");
        filledCollection.add(filledCollection);

        Assertions.assertEquals("null", CollectionUtils.toString(nullCollection));
        Assertions.assertEquals("[]", CollectionUtils.toString(emptyCollection));
        Assertions.assertEquals("[\"Foo\", \"Bar\", (this ArrayList)]", CollectionUtils.toString(filledCollection));
    }