public static Map<String, Object> castToStringObjectMap(Map<?, ?> inputMap) {
        Map<String, Object> map = new HashMap<>(inputMap.size());
        for (Map.Entry<?, ?> entry : inputMap.entrySet()) {
            if (entry.getKey() instanceof String) {
                String k = (String) entry.getKey();
                map.put(k, entry.getValue());
            } else {
                throw new ConfigException(String.valueOf(entry.getKey()), entry.getValue(), "Key must be a string.");
            }
        }
        return map;
    }
Cast a map with arbitrary type keys to be keyed on String.
@param inputMap A map with unknown type keys
@return A map with the same contents as the input map, but with String keys
@throws ConfigException if any key is not a String
clients/src/main/java/org/apache/kafka/common/utils/Utils.java