将数组转换为列表
/** from 时 代 Java - nowjava.com**/ //package com.nowjava; import java.util.ArrayList; import java.util.Collections; import java.util.List; public class Main { @SafeVarargs public static <E> List<E> asList(E... elements) { if (elements == null || elements.length == 0) { return Collections.emptyList(); } int capacity = computeListCapacity(elements.length); ArrayList<E> list = new ArrayList<E>(capacity); Collections.addAll(list, elements); return list; } /** 来 自 N o w J a v a . c o m - 时 代 Java **/ static int computeListCapacity(