public static <K, V> Map<K, V> mapOf(K key, V value, K key2, V value2) {
    Map<K, V> map = new LinkedHashMap<>();
    map.put(key, value);
    map.put(key2, value2);
    return map;
  }
(Partial) replacement for Arrays.copyOfRange, which is only available in JDK6.
spock-core/src/main/java/org/spockframework/util/CollectionUtil.java