This should be:

    Class<? extends AnnotationValidator> clazz = validateWithAnnotation.value();

... then you can avoid the cast in the "try" block below.