public final class Lists extends Object
java.util.List
s.Modifier and Type | Method and Description |
---|---|
static <T> List<T> |
emptyList() |
static <T> List<T> |
list(T... elements) |
static <T> ArrayList<T> |
newArrayList()
Creates a mutable
ArrayList . |
static <T> ArrayList<T> |
newArrayList(Iterable<? extends T> elements)
Creates a mutable
ArrayList containing the given elements. |
static <T> ArrayList<T> |
newArrayList(Iterator<? extends T> elements)
Creates a mutable
ArrayList containing the given elements. |
static <T> ArrayList<T> |
newArrayList(T... elements)
Creates a mutable
ArrayList containing the given elements. |
@SafeVarargs public static <T> ArrayList<T> newArrayList(T... elements)
ArrayList
containing the given elements.T
- the generic type of the ArrayList
to create.elements
- the elements to store in the ArrayList
.ArrayList
, of null
if the given array of elements is null
.@SafeVarargs public static <T> List<T> list(T... elements)
public static <T> ArrayList<T> newArrayList(Iterable<? extends T> elements)
ArrayList
containing the given elements.T
- the generic type of the ArrayList
to create.elements
- the elements to store in the ArrayList
.ArrayList
, or null
if the given Iterable
is null
.public static <T> ArrayList<T> newArrayList(Iterator<? extends T> elements)
ArrayList
containing the given elements.T
- the generic type of the ArrayList
to create.elements
- the elements to store in the ArrayList
.ArrayList
, or null
if the given Iterator
is null
.public static <T> ArrayList<T> newArrayList()
ArrayList
.T
- the generic type of the ArrayList
to create.ArrayList
, of null
if the given array of elements is null
.public static <T> List<T> emptyList()
T
- the generic type of the List
.List
.Copyright © 2014–2019 AssertJ. All rights reserved.