code: public String privilegesMapToYml(Map<String, Collection<Privilege>> privileges) {
          try {
              return mapper.writeValueAsString(privileges);
          } catch (Exception e) {
              log.error("Failed to create privileges YML file from map, error: {}", e.getMessage(), e);
          }
          return null;
      }
docs: Convert privileges map to yml string.
  
  @param privileges map
  @return yml string