@SafeVarargs
  public static <E> List<E> listOf(E... elements) {
    List<E> result = new ArrayList<>(elements.length);
    result.addAll(asList(elements));
    return result;
  }
(Partial) replacement for Arrays.copyOfRange, which is only available in JDK6.
spock-core/src/main/java/org/spockframework/util/CollectionUtil.java