Java examples for java.util:Collection Search
Return a collection as Constant List
//package com.java2s; import java.util.*; public class Main { public static <T> List<T> asConstList(T... in) { return Collections.unmodifiableList(Arrays.asList(Arrays.copyOf(in, in.length)));/*from w w w . ja v a 2 s . c om*/ } public static <T> List<T> asConstList(Collection<T> in) { ArrayList<T> ret = new ArrayList(in); ret.trimToSize(); return Collections.unmodifiableList(ret); } }