The list of methods to do Collection to Array are organized into topic(s).
Object[]
asArray(Collection c) Returns an array with the elements in a given collection.
Object[] array = new Object[c.size()];
int i = 0;
for (Iterator it = c.iterator(); it.hasNext();) {
array[i++] = it.next();
return array;
boolean[]
asBooleanArray(Collection collection) as Boolean Array
boolean[] array = new boolean[collection.size()];
Iterator<Boolean> iterator = collection.iterator();
int i = 0;
while (iterator.hasNext()) {
array[i++] = iterator.next();
return array;
int[]
collectionToIntArray(Collection c) collection To Int Array
int[] toReturn = new int[c.size()];
Iterator<Integer> it = c.iterator();
for (int i = 0; i < toReturn.length; i++) {
toReturn[i] = it.next().intValue();
return toReturn;
Object[]
collectionToObjectArray(Collection c) Convenience method for converting a collection to an Object[]
if (c == null)
return new Object[0];
return c.toArray(new Object[c.size()]);
CharSequence
collectionToObjectArray(final Collection _list) collection To Object Array
final StringBuilder ret = new StringBuilder();
if (!_list.isEmpty()) {
boolean first = true;
ret.append("[");
for (final CharSequence entry : _list) {
if (first) {
first = false;
} else {
...