Here you can find the source of copy2Collection(Object[] strs)
public static Collection copy2Collection(Object[] strs)
//package com.java2s; /**// ww w .j a v a 2 s. c om * Copyright (c) 2004-2011 Wang Jinbao(Julian Wong), http://www.ralasafe.com * Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php */ import java.util.ArrayList; import java.util.Collection; public class Main { public static Collection copy2Collection(Object[] strs) { Collection result = null; if (strs == null) { result = new ArrayList(0); } else { result = new ArrayList(strs.length); for (int i = 0; i < strs.length; i++) { // String s=strs[i]; result.add(strs[i]); } } return result; } }