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 testMapToString() {
        Map<Object, Object> nullMap = null;
        Map<Object, Object> emptyMap = new HashMap<>();
        Map<Object, Object> filledMap = new HashMap<>();

        filledMap.put("aaa", "111");
        filledMap.put("bbb", "222");
        filledMap.put("self", filledMap);

        Assertions.assertEquals("null", CollectionUtils.toString(nullMap));
        Assertions.assertEquals("{}", CollectionUtils.toString(emptyMap));
        Assertions.assertEquals("{\"aaa\"->\"111\", \"bbb\"->\"222\", \"self\"->(this HashMap)}", CollectionUtils.toString(filledMap));
    }