private static String getDebug(final String message, final Map<?, ?> map) {
        final StringBuilder result = new StringBuilder();

        if (map == null) {
            return message + " map: " + null;
        }

        final List<Object> keys = new ArrayList<>(map.keySet());
        result.append(message + " map: " + keys.size() + NEWLINE);
        for (int i = 0; i < keys.size(); i++) {
            final Object key = keys.get(i);
            final Object value = map.get(key);
            result.append("\t" + i + ": '" + key + "' -> '" + value + "'" + NEWLINE);
        }

        result.append(NEWLINE);

        return result.toString();
    }
Internal-only debug class. Used for collecting extra information when parsing or modifying images or metadata. These methods are useful for troubleshooting
and issue analysis, but this should not be used directly by end-users, nor extended in any way. This may change or be removed at any time.
src/main/java/org/apache/commons/imaging/internal/Debug.java