code: @SuppressWarnings("unchecked")
    public static Map<String, String> toStringMap(Object map) {
      if (map == null) {
        return null;
      }
  
      if (map instanceof Map) {
        Map<Object, Object> rawMap = (Map<Object, Object>) map;
        Map<String, String> stringMap = new HashMap<>();
        for (Entry<Object, Object> entry : rawMap.entrySet()) {
          stringMap.put(entry.getKey().toString(), entry.getValue().toString());
        }
        return stringMap;
      } else {
        throw new AvroRuntimeException("value must be a map");
      }
    }
docs: Given a map: key -> value, return a map: key.toString() -> value.toString(). Avro serializer wraps a String
  into {@link Utf8}. This method helps to restore the original string map object
  
  @param map a map object
  @return a map of strings