MCPcopy
hub / github.com/assertj/assertj / newArrayList

Method newArrayList

src/main/java/org/assertj/core/util/Lists.java:35–43  ·  view source on GitHub ↗

Creates a mutable ArrayList containing the given elements. @param the generic type of the ArrayList to create. @param elements the elements to store in the ArrayList. @return the created ArrayList, of null if the given array of elements is {@code

(T... elements)

Source from the content-addressed store, hash-verified

33 * @return the created {@code ArrayList}, of {@code null} if the given array of elements is {@code null}.
34 */
35 @SafeVarargs
36 public static <T> ArrayList<T> newArrayList(T... elements) {
37 if (elements == null) {
38 return null;
39 }
40 ArrayList<T> list = newArrayList();
41 java.util.Collections.addAll(list, elements);
42 return list;
43 }
44
45 /**
46 * Creates a <em>mutable</em> {@link ArrayList} containing the given elements.

Calls 2

hasNextMethod · 0.80
nextMethod · 0.80