Top Constructors Methods
org.testng.collections

public final Class Lists

extends Object
Class Inheritance
Imports
java.util.*, java.util.function.BiPredicate, java.util.stream.Collectors

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static <K> List<K>
intersection(List<K> list1, List<K> list2)

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

public static <
- The generic type
T
>
List<T>

Returns:

- The merged list.
merge
(List<T>
- The first list
l1
,
BiPredicate<T, T>
- The condition that is used to determine if an element is to be added or not.
condition
,
List<T>...
- The lists which are to be merged into the first list
lists
)

Utility method that merges two lists by applying the provided condition.

public static <K> List<K>
public static <K> List<K>
public static <K> List<K>
public static <K> List<K>
newArrayList(K... elements)

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

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

public static <K> List<K>
public static <K> List<K>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Listsback to summary
private Lists()

Method Detail

intersectionback to summary
public static <K> List<K> intersection(List<K> list1, List<K> list2)
mergeback to summary
public static <K> List<K> merge(Collection<K> l1, Collection<K> l2)
mergeback to summary
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.

Parameters
<T>
- The generic type
l1:List<T>

- The first list

condition:BiPredicate<T, T>

- The condition that is used to determine if an element is to be added or not.

lists:List<T>[]

- The lists which are to be merged into the first list

Returns:List<T>

- The merged list.

Annotations
@SafeVarargs
newArrayListback to summary
public static <K> List<K> newArrayList()
newArrayListback to summary
public static <K> List<K> newArrayList(Collection<K> c)
newArrayListback to summary
public static <K> List<K> newArrayList(Iterator<K> c)
newArrayListback to summary
public static <K> List<K> newArrayList(K... elements)
Annotations
@SafeVarargs
newArrayListback to summary
public static <K> List<K> newArrayList(K[]... elements)
Annotations
@SafeVarargs
newArrayListback to summary
public static <K> List<K> newArrayList(int size)
newLinkedListback to summary
public static <K> List<K> newLinkedList()
newLinkedListback to summary
public static <K> List<K> newLinkedList(Collection<K> c)