Java tutorial
//package com.java2s; import java.util.ArrayList; import java.util.Collections; public class Main { public static <T> ArrayList<T> toArrayList(T[] items) { if (items == null || items.length == 0) { return null; } ArrayList<T> list = new ArrayList<>(); Collections.addAll(list, items); return list; } }