Copies the content of the collection to an array.

@param coll the collection
@return the array
514036
public static byte[] byteArrayCopyOf(CollectionNumber coll) {
        byte[] data = new byte[coll.size()];
        IteratorNumber iter = coll.iterator();
        int index = 0;
        while (iter.hasNext()) {
            data[index] = iter.nextByte();
            index++;
        }
        return data;
    }
637016
public static String[][] unboxStringArrays(Collection<String[]> coll) {
    return coll.toArray(new String[coll.size()][]);
  }
192156
private function setCollection(PersistentCollectionInterface $coll)
    {
        list($qb, $path, $parent) = $this->getQueryPathAndParent($coll);

        $coll->initialize();

        $path->set($coll);
        $this->executeQuery($qb, $parent);
    }
1101727
public static byte[] byteArrayWrappedOrCopy(CollectionNumber coll) {
        byte[] array = wrappedByteArray(coll);
        if (array != null) {
            return array;
        }
        return byteArrayCopyOf(coll);
    }
661036
public <E extends T> void filter (Collection<E> coll)
    {
        for (Iterator<E> itr = coll.iterator(); itr.hasNext(); ) {
            if (!isMatch(itr.next())) {
                itr.remove();
            }
        }
    }
713253
public static float[] floatArrayCopyOf(CollectionNumber coll) {
        float[] data = new float[coll.size()];
        IteratorNumber iter = coll.iterator();
        int index = 0;
        while (iter.hasNext()) {
            data[index] = iter.nextFloat();
            index++;
        }
        return data;
    }
586228
public static <T> JSONArray toJSONArray(final Collection<T> collection) {
        final JSONArray ret = new JSONArray();

        if (null == collection) {
            return ret;
        }

        for (final T object : collection) {
            ret.put(object);
        }

        return ret;
    }
965116
public final ContentPart<?>[] getContentAsParts()
    {
        if(!this.contentType.equals(ContentType.MULTI_PART))
        {
            throw new FaxException("Current content type is: "+this.contentType);
        }

        ContentPart<?>[] clone=null;
        if(this.contentParts!=null)
        {
            clone=this.contentParts.clone();
        }
        return clone;
    }
473017
public static float[] floatArrayWrappedOrCopy(CollectionNumber coll) {
        float[] array = wrappedFloatArray(coll);
        if (array != null) {
            return array;
        }
        return floatArrayCopyOf(coll);
    }
1031334
public static <T extends Object & Comparable<? super T>> Pair<T, T> minAndMax(Collection<? extends T> coll) {
		Iterator<? extends T> i = coll.iterator();
		T minCandidate = i.next();
		T maxCandidate = minCandidate;

		while (i.hasNext()) {
			T next = i.next();
			if (next.compareTo(minCandidate) < 0) {
				minCandidate = next;
			} else if (next.compareTo(maxCandidate) > 0) {
				maxCandidate = next;
			}
		}
		return Pair.of(minCandidate, maxCandidate);
	}
971114
private JSONArray toJsonStringArray(Collection<? extends Object> collection) {

        if (null != collection) {
            JSONArray array = new JSONArray();
            for (Object o : collection) {
                array.put("" + o);
            }
            return array;
        } else {
            return null;
        }
    }
285309
public static double[] doubleArrayWrappedOrCopy(CollectionNumber coll) {
        double[] array = wrappedDoubleArray(coll);
        if (array != null) {
            return array;
        }
        return doubleArrayCopyOf(coll);
    }
1250190
private static void quoteList(final Collection<String> coll, final StringBuilder buf) {
        buf.append('[');
        boolean first = true;
        for (final String item : coll) {
            if (first) {
                first = false;
            } else {
                buf.append(", ");
            }
            buf.append('"');
            for (int i = 0; i < item.length(); i++) {
                final char c = item.charAt(i);
                if (c == '"') {
                    buf.append("\\\"");
                } else {
                    buf.append(c);
                }
            }
            buf.append('"');
        }
        buf.append(']');
    }
256037
private static String getCommaSeparatedString(Collection<String> coll) {

		StringBuilder buffer = new StringBuilder();
		for (Iterator<String> eltIterator = coll.iterator(); eltIterator.hasNext();) {
			String elt = eltIterator.next();
			buffer.append(elt);
			if (eltIterator.hasNext()) {
				buffer.append(COMMA_SEPARATOR);
			}
		}
		return buffer.toString();
	}
926878
@SafeVarargs
	public static <T> Collection<T> union(Collection<T> coll1, Collection<T> coll2, Collection<T>... otherColls) {
		Collection<T> union = union(coll1, coll2);
		for (Collection<T> coll : otherColls) {
			union = union(union, coll);
		}
		return union;
	}
208723
public boolean addAll(final IntHashSet coll)
    {
        boolean acc = false;

        for (final int value : coll.values)
        {
            if (value != MISSING_VALUE)
            {
                acc |= add(value);
            }
        }

        if (coll.containsMissingValue)
        {
            acc |= add(MISSING_VALUE);
        }

        return acc;
    }
705572
static <T> Collection<T> freeze(Collection<T> coll) {
        return coll == null ? null : Collections.unmodifiableCollection(coll);
    }