public static Expression getVariableName(BinaryExpression assignment) {
    Expression left = assignment.getLeftExpression();
    if (left instanceof Variable) return new ConstantExpression(((Variable) left).getName());
    if (left instanceof FieldExpression) return new ConstantExpression(((FieldExpression) left).getFieldName());
    return ConstantExpression.NULL;
  }
Turns an argument list obtained from AstUtil.getArguments() into an Object[] array
suitable to be passed to InvokerHelper or SpockRuntime. The main challenge is
to handle SpreadExpression's correctly.
spock-core/src/main/java/org/spockframework/compiler/AstUtil.java