code: public static List<NamespaceDto> transformToDto(List<Namespace> namespaces) {
          if (namespaces == null) {
              throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR);
          }
  
          List<NamespaceDto> result = new ArrayList<>();
  
          for (Namespace namespace : namespaces) {
              result.add(transformToDto(namespace));
          }
          return result;
      }
docs: Converts list of alert entity objects to list of alertDto objects.
  
  @param   namespaces  users alerts List of alert entities. Cannot be null.
  
  @return  List of alertDto objects.
  
  @throws  WebApplicationException  If an error occurs.