code: public static HistoryDTO transformToDto(History history) {
          if (history == null) {
              throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR);
          }
  
          HistoryDTO historyDto = new HistoryDTO();
  
          try {
              BeanUtils.copyProperties(historyDto, history);
          } catch (Exception ex) {
              throw new WebApplicationException("DTO transformation failed.", Status.INTERNAL_SERVER_ERROR);
          }
          return historyDto;
      }
docs: Converts a history object to DTO.
  
  @param   history  The history object.
  
  @return  The history DTO.
  
  @throws  WebApplicationException  If an error occurs.