Package org.assertj.core.util
Class Lists
java.lang.Object
org.assertj.core.util.Lists
Utility methods related to
Lists.- 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 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 Details
-
list
-
newArrayList
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.
-
newArrayList
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
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
Creates a mutableArrayList.- Type Parameters:
T- the generic type of theArrayListto create.- Returns:
- the created
ArrayList, ofnullif 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.