public static boolean isWildcardRef(Expression expr) {
    VariableExpression varExpr = ObjectUtil.asInstance(expr, VariableExpression.class);
    if (varExpr == null || !varExpr.getName().equals(Wildcard.INSTANCE.toString())) return false;

    Variable accessedVar = varExpr.getAccessedVariable();
    if (!(accessedVar instanceof FieldNode)) return false;

    return ((FieldNode) accessedVar).getOwner().getName().equals(Specification.class.getName());
  }
Returns a list of statements of the given method. Modifications to the returned list
will affect the method's statements.

@param method a method (node)
@return a list of statements of the given method
spock-core/src/main/java/org/spockframework/compiler/AstUtil.java