public static Expression getInvocationTarget(Expression expr) {
    if (expr instanceof PropertyExpression)
      return ((PropertyExpression) expr).getObjectExpression();
    if (expr instanceof MethodCallExpression)
      return ((MethodCallExpression) expr).getObjectExpression();
    if (expr instanceof StaticMethodCallExpression)
      return new ClassExpression(((StaticMethodCallExpression) expr).getOwnerType());
    if (expr instanceof ConstructorCallExpression)
      return new ClassExpression(expr.getType());
    return null;
  }
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