public static <T> Set<T> asSet(T[] values) {
    return new HashSet<>(asList(values));
  }
(Partial) replacement for Arrays.copyOfRange, which is only available in JDK6.
spock-core/src/main/java/org/spockframework/util/CollectionUtil.java