public static <T> void addLastElement(List<T> list, T element) {
    list.add(list.size(), element);
  }
(Partial) replacement for Arrays.copyOfRange, which is only available in JDK6.
spock-core/src/main/java/org/spockframework/util/CollectionUtil.java