private List<Object> expandVarArgs(List<Object> args) {
    List<Object> expanded = new ArrayList<>(args.subList(0, args.size() - 1));

    Object varArgs = CollectionUtil.getLastElement(args);
    int length = Array.getLength(varArgs);
    for (int i = 0; i < length; i++) {
      expanded.add(Array.get(varArgs, i));
    }

    return expanded;
  }
Tells if the given method call has expandable varargs. Note that Groovy
supports vararg syntax for all methods whose last parameter is of array type.
spock-core/src/main/java/org/spockframework/mock/constraint/PositionalArgumentListConstraint.java