Java tutorial
//package com.java2s; import org.springframework.util.ObjectUtils; import java.util.*; public class Main { /** * Convert the supplied array into a List. A primitive array gets * converted into a List of the appropriate wrapper type. * <p>A <code>null</code> source value will be converted to an * empty List. * @param source the (potentially primitive) array * @return the converted List result * @see org.springframework.util.ObjectUtils#toObjectArray(Object) */ public static List arrayToList(Object source) { return Arrays.asList(ObjectUtils.toObjectArray(source)); } }