Here you can find the source of convertArrayInCollection(String[] array)
static public Collection convertArrayInCollection(String[] array)
//package com.java2s; /* SpagoBI, the Open Source Business Intelligence suite // w w w . j av a 2 s. co m * Copyright (C) 2012 Engineering Ingegneria Informatica S.p.A. - SpagoBI Competency Center * This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0, without the "Incompatible With Secondary Licenses" notice. * If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. */ import java.util.ArrayList; import java.util.Collection; public class Main { static public Collection convertArrayInCollection(String[] array) { Collection coll = new ArrayList(); for (int i = 0; i < array.length; i++) { String role = array[i]; coll.add(role); } return coll; } }