code: public static AnnotationDto transformToDto(Annotation annotation) {
          if (annotation == null) {
              throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR);
          }
  
          AnnotationDto result = createDtoObject(AnnotationDto.class, annotation);
  
          return result;
      }
docs: Converts annotation entity to DTO.
  
  @param   annotation  The annotation entity.  Cannot be null.
  
  @return  The annotation DTO.
  
  @throws  WebApplicationException  If an error occurs.