Java tutorial
//package com.java2s; //License from project: Apache License import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class Main { public static <T> ArrayList<T> toArrayList(Object[] arr) { List list = toList(arr); ArrayList<T> arrayList = new ArrayList<T>(); arrayList.addAll(list); return arrayList; } public static List toList(Object[] arr) { List list = Arrays.asList(arr); return list; } }