public static List<Object> arrayToList(Object array) {
    List<Object> result = new ArrayList<>();
    int length = Array.getLength(array);
    for (int i = 0; i < length; i++) {
      result.add(Array.get(array, i));
    }
    return result;
  }
(Partial) replacement for Arrays.copyOfRange, which is only available in JDK6.
spock-core/src/main/java/org/spockframework/util/CollectionUtil.java