Class CollectionUtil

java.lang.Object
org.spockframework.util.CollectionUtil

public abstract class CollectionUtil extends Object
  • Constructor Details

    • CollectionUtil

      public CollectionUtil()
  • Method Details

    • filterMap

      public static <E, F> ArrayList<F> filterMap(Collection<E> collection, IFunction<E,F> function)
    • copyArray

      public static Object[] copyArray(Object[] array, int from, int to)
      (Partial) replacement for Arrays.copyOfRange, which is only available in JDK6.
    • getLastElement

      public static <T> T getLastElement(List<T> list)
    • setLastElement

      public static <T> void setLastElement(List<T> list, T elem)
    • addLastElement

      public static <T> void addLastElement(List<T> list, T element)
    • reverse

      public static <T> Iterable<T> reverse(List<T> list)
    • asSet

      public static <T> Set<T> asSet(T[] values)
    • mapOf

      public static <K, V> Map<K,V> mapOf(K key, V value)
    • mapOf

      public static <K, V> Map<K,V> mapOf(K key, V value, K key2, V value2)
    • mapOf

      public static <K, V> Map<K,V> mapOf(K key, V value, K key2, V value2, K key3, V value3)
    • concat

      public static <T> Iterable<T> concat(Iterable<? extends T>... iterables)
    • concat

      public static <T> Iterable<T> concat(List<Iterable<? extends T>> iterables)
    • containsAny

      public static boolean containsAny(Iterable<?> iterable, Object... elements)