public static boolean hasAnnotation(ASTNode node, Class<?> annotationType) {
    return getAnnotation(node, annotationType) != null;
  }
Tells whether the given node has an annotation of the given type.

@param node an AST node
@param annotationType an annotation type
@return <tt>true</tt> iff the given node has an annotation of the given type
spock-core/src/main/java/org/spockframework/compiler/AstUtil.java