@Nullable
  public static <T> T getFirstElement(Iterable<T> iterable) {
    Iterator<T> iterator = iterable.iterator();
    Assert.that(iterator.hasNext());
    return iterator.next();
  }
(Partial) replacement for Arrays.copyOfRange, which is only available in JDK6.
spock-core/src/main/java/org/spockframework/util/CollectionUtil.java