Package org.testng.collections
Class Lists
java.lang.Object
org.testng.collections.Lists
-
Method Summary
Modifier and TypeMethodDescriptionstatic <K> List<K>
intersection
(List<K> list1, List<K> list2) static <K> List<K>
merge
(Collection<K> l1, Collection<K> l2) 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.static <K> List<K>
static <K> List<K>
newArrayList
(int size) static <K> List<K>
newArrayList
(Collection<K> c) static <K> List<K>
newArrayList
(Iterator<K> c) static <K> List<K>
newArrayList
(K... elements) static <K> List<K>
newArrayList
(K[]... elements) static <K> List<K>
static <K> List<K>
newLinkedList
(Collection<K> c)
-
Method Details
-
newArrayList
-
newLinkedList
-
newLinkedList
-
newArrayList
-
newArrayList
-
newArrayList
-
newArrayList
-
newArrayList
-
intersection
-
merge
-
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 listcondition
- - 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.
-