Here you can find the source of createArrayList()
public static <E> ArrayList<E> createArrayList()
//package com.java2s; import java.util.ArrayList; import java.util.Collection; public class Main { public static <E> ArrayList<E> createArrayList() { return new ArrayList<E>(); }/* w ww .ja v a 2s .c o m*/ public static <E> ArrayList<E> createArrayList(int initialCapacity) { return new ArrayList<E>(initialCapacity); } public static <E> ArrayList<E> createArrayList(Collection<? extends E> collection) { if (collection == null) { return new ArrayList<E>(); } return new ArrayList<E>(collection); } public static <E> ArrayList<E> createArrayList(Iterable<? extends E> iter) { if (iter instanceof Collection<?>) { return new ArrayList<E>((Collection<? extends E>) iter); } ArrayList<E> list = new ArrayList<E>(); iterableToCollection(iter, list); list.trimToSize(); return list; } public static <T, V extends T> ArrayList<T> createArrayList(V... args) { if (args == null || args.length == 0) { return new ArrayList<T>(); } ArrayList<T> list = new ArrayList<T>(args.length); for (V v : args) { list.add(v); } return list; } private static <E> void iterableToCollection(Iterable<? extends E> iter, Collection<E> list) { if (iter == null) { return; } for (E element : iter) { list.add(element); } } }