Java tutorial
//package com.java2s; //License from project: LGPL import java.util.ArrayList; public class Main { public static <T> ArrayList<T> convertPrimitiveArrayToList(T[] data) { ArrayList<T> ret = new ArrayList<T>(); for (int i = 0; i < data.length; i++) { ret.add(data[i]); } return ret; } }