class Strings {

    private static String collectionToString(Collection collection) {
        StringBuilder builder = new StringBuilder("[");
        int count = 0;
        for (Object element : collection) {
            if (builder.length() > LOG_CONTENT_MAX_LENGTH) {
                return builder.append("] (" + count + ":" + collection.size() + ")").toString();
            }
            if (count > 0) {
                builder.append(", ");
            }
            count++;
            if (element == null) {
                builder.append("null");
            } else {
                Class elementClass = element.getClass();
                if (elementClass.isArray() && elementClass.getComponentType() == Object.class) {
                    Object[] arrayElement = (Object[]) element;
                    arrayToString(arrayElement, builder, new HashSet<Object[]>());
                } else {
                    builder.append(toString(element));
                }
            }
        }
        return builder.append(']').toString();
    }

    private  Strings();

}