Here you can find the source of createArrayList(Iterable
public static <T> ArrayList<T> createArrayList(Iterable<T> items, int size)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; public class Main { public static <T> ArrayList<T> createArrayList(Iterable<T> items, int size) { ArrayList<T> al = new ArrayList<>(size); for (T item : items) { al.add(item);// w w w. j a v a2s .co m } return al; } }