Java tutorial
//package com.java2s; import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class Main { /** * Convert an array to a list * @param array an array * @return List */ public static <T> List<T> arrayToList(T array[]) { if (array != null) { List<T> list = new ArrayList<>(); list.addAll(Arrays.asList(array)); return list; } return null; } }