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