Make collection into an integer array.

@param collection The value instance.
@return The array.
186748
public static int[] asIntegerArray(Collection collection) {
        int[] result = new int[collection.size()];
        int i = 0;
        for (Object c : collection) {
            result[i++] = asInteger(c);
        }
        return result;
    }
870874
public static int[] asIntegerTypeArray(List<Integer> input) {
		int[] result = new int[input.size()];

		for (int i = 0; i < result.length; i++) {
			result[i] = input.get(i);
		}

		return result;
	}
784968
public static byte[] intArrayToBytes(Collection<Integer> values)
    {
        ByteBuffer buffer = ByteBuffer.allocate(values.size() * Integer.BYTES);
        for (int value : values) {
            buffer.putInt(value);
        }
        return buffer.array();
    }
462459
public int[] toArray() {
		int[] a = new int[this.collection.size()];
		int i = 0;
		for (int col : this.collection) {
			a[i++] = col;
		}
		return a;
	}
1355474
public final <C extends Collection<? super T>> C copyInto(C collection) {
        requireNonNull(collection);
        for (T item : this) {
            collection.add(item);
        }
        return collection;
    }
70061
public static <T> Collection<T> addAll(Collection<T> collection, Object value) {
		return addAll(collection, value, TypeUtil.getTypeArgument(collection.getClass()));
	}
937236
static String toStringImpl(final Collection<?> collection) {
    StringBuilder sb = newStringBuilderForCollection(collection.size()).append('[');
    STANDARD_JOINER.appendTo(
        sb,
        Iterables.transform(
            collection,
            new Function<Object, Object>() {
              @Override
              public Object apply(Object input) {
                return input == collection ? "(this Collection)" : input;
              }
            }));
    return sb.append(']').toString();
  }
649727
public static List<Integer> asList(int[] array) {
    List<Integer> l = new ArrayList<Integer>();
    for (int i : array) {
      l.add(i);
    }
    return l;
  }
1317320
public static int[] toIntArray(Collection<Integer> collection) {
        int[] collectionArray = new int[collection.size()];
        int index = 0;
        for (Integer item : collection) {
            collectionArray[index++] = item;
        }
        return collectionArray;
    }
591623
public static <T> ArrayList<T> newArrayList(Collection<T> collection) {
		return (ArrayList<T>) list(false, collection);
	}
784231
public static long[] asLongArray(Collection collection) {
        long[] result = new long[collection.size()];
        int i = 0;
        for (Object c : collection) {
            result[i++] = asLong(c);
        }
        return result;
    }
620675
public static <T> List<T> convertCollectionToList(final Collection<T> collection) {

        if(List.class.isAssignableFrom(collection.getClass())) {
            return (List<T>)collection;
        }

        return new ArrayList<>(collection);

    }
900428
@SuppressWarnings("unchecked")
    public static <T> PromisesArray<T> of(Collection<T> collection) {
        final ArrayList<Promise<T>> res = new ArrayList<>();
        for (T t : collection) {
            res.add(Promise.success(t));
        }
        final Promise[] promises = res.toArray(new Promise[res.size()]);
        return new PromisesArray<>((PromiseFunc<Promise<T>[]>) executor -> {
            executor.result(promises);
        });
    }
1111526
public function values($collection=null) {
    list($collection) = self::_wrapArgs(func_get_args(), 1);
    
    return self::_wrap(array_values((array) $collection));
  }
102572
public static function fromCollection($collection) {
		if (!(is_array($collection) || $collection instanceof Iterator)) {
			throw new InvalidArgumentException('$collection is neither an array nor an iterator');
		}

		return self::toCollection($collection);
	}
644447
public Packer putStringCollection(final Collection<String> collection) {
		putVInt(collection.size());
		for (final String value : collection) {
			putString(value);
		}
		return this;
	}
732328
public Collection<V> put(K key, Collection<V> collection) {
    return map.put(key, collection);
  }