public static Predicate<Annotation> annotationIsOfClass(final Class<? extends Annotation> annotationClass) {
        return candidate -> candidate != null && candidate.annotationType().equals(annotationClass);
    }
public static Predicate < Annotation > annotationIsOfClass ( final Class < ? extends Annotation > annotationClass ) { return candidate -> candidate != null && candidate . annotationType ( ) . equals ( annotationClass ) ; }
Checks if the candidate annotation is of the specified annotation class.

@param annotationClass the annotation class to check for.
@return the predicate.