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;
}

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 ; }
converts list of alert entity objects to list of alertdto objects .
