Package org.assertj.core.util
Class Lists
- java.lang.Object
-
- org.assertj.core.util.Lists
-
public final class Lists extends Object
Utility methods related tojava.util.Lists.- Author:
- Yvonne Wang, Alex Ruiz, Joel Costigliola
-
-
Constructor Summary
Constructors Modifier Constructor Description privateLists()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> List<T>emptyList()static <T> List<T>list(T... elements)static <T> ArrayList<T>newArrayList()Creates a mutableArrayList.static <T> ArrayList<T>newArrayList(Iterable<? extends T> elements)Creates a mutableArrayListcontaining the given elements.static <T> ArrayList<T>newArrayList(Iterator<? extends T> elements)Creates a mutableArrayListcontaining the given elements.static <T> ArrayList<T>newArrayList(T... elements)Creates a mutableArrayListcontaining the given elements.
-
-
-
Method Detail
-
newArrayList
@SafeVarargs public static <T> ArrayList<T> newArrayList(T... elements)
Creates a mutableArrayListcontaining the given elements.- Type Parameters:
T- the generic type of theArrayListto create.- Parameters:
elements- the elements to store in theArrayList.- Returns:
- the created
ArrayList, ofnullif the given array of elements isnull.
-
list
@SafeVarargs public static <T> List<T> list(T... elements)
-
newArrayList
public static <T> ArrayList<T> newArrayList(Iterable<? extends T> elements)
Creates a mutableArrayListcontaining the given elements.- Type Parameters:
T- the generic type of theArrayListto create.- Parameters:
elements- the elements to store in theArrayList.- Returns:
- the created
ArrayList, ornullif the givenIterableisnull.
-
newArrayList
public static <T> ArrayList<T> newArrayList(Iterator<? extends T> elements)
Creates a mutableArrayListcontaining the given elements.- Type Parameters:
T- the generic type of theArrayListto create.- Parameters:
elements- the elements to store in theArrayList.- Returns:
- the created
ArrayList, ornullif the givenIteratorisnull.
-
newArrayList
public static <T> ArrayList<T> newArrayList()
Creates a mutableArrayList.- Type Parameters:
T- the generic type of theArrayListto create.- Returns:
- the created
ArrayList, ofnullif the given array of elements isnull.
-
emptyList
public static <T> List<T> emptyList()
- Type Parameters:
T- the generic type of theList.- Returns:
- an empty, immutable
List.
-
-