将数组和迭代器转换为列表
/** from n o w j a v a . c o m**/ //package com.book2s; import java.util.ArrayList; import java.util.Iterator; import java.util.List; public class Main { public static <E> List<E> asList( @SuppressWarnings("unchecked") final E... array) { List<E> list = new ArrayList<>(array.length); for (E element : array) { list.add(element); } return list; } /* 时 代 Java - nowjava.com */ public static <E> List<E> asList(final Iterator<? extends E> iterator) { List<E> list =