Package org.assertj.core.util
Class Lists
java.lang.Object
org.assertj.core.util.Lists
Utility methods related to
List
s.- Author:
- Yvonne Wang, Alex Ruiz, Joel Costigliola
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> List
<T> Deprecated.static <T> List
<T> list
(T... elements) static <T> ArrayList
<T> Creates a mutableArrayList
.static <T> ArrayList
<T> newArrayList
(Iterable<? extends T> elements) Creates a mutableArrayList
containing the given elements.static <T> ArrayList
<T> newArrayList
(Iterator<? extends T> elements) Creates a mutableArrayList
containing the given elements.static <T> ArrayList
<T> newArrayList
(T... elements) Creates a mutableArrayList
containing the given elements.
-
Method Details
-
list
-
newArrayList
Creates a mutableArrayList
containing the given elements.- Type Parameters:
T
- the generic type of theArrayList
to create.- Parameters:
elements
- the elements to store in theArrayList
.- Returns:
- the created
ArrayList
, ofnull
if the given array of elements isnull
.
-
newArrayList
Creates a mutableArrayList
containing the given elements.- Type Parameters:
T
- the generic type of theArrayList
to create.- Parameters:
elements
- the elements to store in theArrayList
.- Returns:
- the created
ArrayList
, ornull
if the givenIterable
isnull
.
-
newArrayList
Creates a mutableArrayList
containing the given elements.- Type Parameters:
T
- the generic type of theArrayList
to create.- Parameters:
elements
- the elements to store in theArrayList
.- Returns:
- the created
ArrayList
, ornull
if the givenIterator
isnull
.
-
newArrayList
Creates a mutableArrayList
.- Type Parameters:
T
- the generic type of theArrayList
to create.- Returns:
- the created
ArrayList
, ofnull
if the given array of elements isnull
.
-
emptyList
Deprecated.useCollections.emptyList()
instead.- Type Parameters:
T
- the generic type of theList
.- Returns:
- an empty, immutable
List
.
-
Collections.emptyList()
instead.