private static Map<String, String> attributeMap(Attributes attributes) {
    Map<String, String> result = new HashMap<>();
    for (Map.Entry<String, Object> entry : attributes.entrySet()) {
      result.put(entry.getKey(), entry.getValue().toString());
    }
    return result;
  }
private static Map<String, String> attributeMap(Attributes attributes)