code: private boolean hasNotNull(AnnotationRepository annotationRepository, Annotation annotation)
     {
        Collection<Annotation> values = annotationRepository.getAnnotation(javax.validation.constraints.NotNull.class);
  
        if (values == null || values.isEmpty())
           return false;
  
        for (Annotation notNullAnnotation : values)
        {
           if (notNullAnnotation.getClassName().equals(annotation.getClassName()) &&
               notNullAnnotation.getMemberName().equals(annotation.getMemberName()))
              return true;
        }
  
        return false;
     }
docs: Has a NotNull annotation attached
  @param annotationRepository The annotation repository
  @param annotation The annotation being checked
  @return True of the method/field contains the NotNull annotation; otherwise false