Class Lists

java.lang.Object
org.testng.collections.Lists

public final class Lists extends Object
  • Method Details

    • newArrayList

      public static <K> List<K> newArrayList()
    • newLinkedList

      public static <K> List<K> newLinkedList()
    • newLinkedList

      public static <K> List<K> newLinkedList(Collection<K> c)
    • newArrayList

      public static <K> List<K> newArrayList(Collection<K> c)
    • newArrayList

      public static <K> List<K> newArrayList(Iterator<K> c)
    • newArrayList

      @SafeVarargs public static <K> List<K> newArrayList(K... elements)
    • newArrayList

      @SafeVarargs public static <K> List<K> newArrayList(K[]... elements)
    • newArrayList

      public static <K> List<K> newArrayList(int size)
    • intersection

      public static <K> List<K> intersection(List<K> list1, List<K> list2)
    • merge

      public static <K> List<K> merge(Collection<K> l1, Collection<K> l2)
    • merge

      @SafeVarargs public static <T> List<T> merge(List<T> l1, BiPredicate<T,T> condition, List<T>... lists)
      Utility method that merges two lists by applying the provided condition.
      Type Parameters:
      T - - The generic type
      Parameters:
      l1 - - The first list
      condition - - The condition that is used to determine if an element is to be added or not.
      lists - - The lists which are to be merged into the first list
      Returns:
      - The merged list.