Java tutorial
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { public static <T> List<T> arrayToList(T[] t) { if (t == null || t.length == 0) { return new ArrayList<T>(0); } List<T> list = new ArrayList<T>(t.length); Collections.addAll(list, t); return list; } }