Lines Matching refs:collection
337 * Copies a collection of {@code Long} instances into a new array of
340 * <p>Elements are copied from the argument collection as if by {@code
341 * collection.toArray()}. Calling this method is as thread-safe as calling
344 * @param collection a collection of {@code Long} objects
345 * @return an array containing the same values as {@code collection}, in the
347 * @throws NullPointerException if {@code collection} or any of its elements
350 public static long[] toArray(Collection<Long> collection) {
351 if (collection instanceof LongArrayAsList) {
352 return ((LongArrayAsList) collection).toLongArray();
355 Object[] boxedArray = collection.toArray();