public static <T> Iterable<T> concat(final List<Iterable<? extends T>> iterables) {
    return () -> new Iterator<T>() {
      Iterator<? extends T> iter;
      int pos = 0;

      @Override
      public boolean hasNext() {
        while (pos < iterables.size()) {
          if (iter == null) iter = iterables.get(pos).iterator();
          if (iter.hasNext()) return true;
          iter = null;
          pos++;
        }
        return false;
      }

      @Override
      public T next() {
        while (pos < iterables.size()) {
          if (iter == null) iter = iterables.get(pos).iterator();
          if (iter.hasNext()) return iter.next();
          iter = null;
          pos++;
        }
        throw new NoSuchElementException();
      }

      @Override
      public void remove() {
        throw new UnsupportedOperationException("remove");
      }
    };
  }
(Partial) replacement for Arrays.copyOfRange, which is only available in JDK6.
spock-core/src/main/java/org/spockframework/util/CollectionUtil.java