public class MinimalList extends Object
size=0: null
size=1: Collections.singletonList
size=2: ArrayList
| Modifier and Type | Method and Description |
|---|---|
static <E> List<E> |
add(List<E> list,
E elem)
Adds a new element to a list, returning the (possibly new) list.
|
static <E> List<E> |
copy(List<E> list)
Performs a shallow copy of a list.
|
static <E> E |
get(List<E> list,
int index)
Gets an element from a list.
|
public static <E> List<E> add(List<E> list, E elem)
public static <E> E get(List<E> list, int index) throws IndexOutOfBoundsException
IndexOutOfBoundsExceptionCopyright © 2016. All rights reserved.