Convert the value to a collection.

@param value The value instance.
@param <T> The collection item type.
@return The collection value.
967075
@SuppressWarnings("unchecked")
    public static <T> Collection<T> asCollection(Object value) {
        if (value instanceof Collection) {
            return (Collection) value;
        }
        throw new IncompatibleValueException(
                "Unable to convert " + value.getClass().getSimpleName() + " to a collection");
    }
739172
public static List<String> get(String name, @Nullable Boolean value) {
    if (value == null) {
      return Collections.emptyList();
    }
    return Arrays.asList("--" + name + "=" + value.toString());
  }
929849
public static <T> Collector<T, ?, ArrayList<T>> toArrayList() {
    return java.util.stream.Collectors.toCollection(ArrayList::new);
  }
1016366
private static <E> Collection<E> toCollection(Iterable<E> iterable) {
		return (iterable instanceof Collection) ? (Collection<E>)iterable : Lists.newArrayList(iterable.iterator());
	}
1358605
public static <T> Collection<T> addAll(Collection<T> collection, T[] values) {
		if (null != collection && null != values) {
			for (T value : values) {
				collection.add(value);
			}
		}
		return collection;
	}
431406
public static Collection<?> toCollection(Class<?> collectionType, Class<?> elementType, Object value) {
		return new CollectionConverter(collectionType, elementType).convert(value, null);
	}
793935
@SuppressWarnings({ "unchecked", "checkstyle:illegaltype" })
	Collection<V> copyValues(Collection<V> values) {
		final Object backEnd = DataViewDelegate.undelegate(values);
		if (backEnd instanceof List<?>) {
			return Lists.newArrayList(values);
		}
		if (backEnd instanceof TreeSet<?>) {
			TreeSet<V> c = (TreeSet<V>) backEnd;
			c = Sets.newTreeSet(c.comparator());
			c.addAll(values);
			return c;
		}
		if (backEnd instanceof LinkedHashSet<?>) {
			return Sets.newLinkedHashSet(values);
		}
		if (backEnd instanceof Set<?>) {
			return Sets.newHashSet(values);
		}
		throw new IllegalStateException("Unsupported type of the backend multimap: " + values.getClass()); //$NON-NLS-1$
	}
1006979
public static <T> ThriftListenableFuture<T> successfulListenableFuture(T value) {
        final ThriftListenableFuture<T> future = new ThriftListenableFuture<>();
        future.onComplete(value);
        return future;
    }
565764
public static String[] asStringArray(Object value) {
        List<String> collection = asCollection(value).stream()
                                                     .map(ConfigUtil::asString)
                                                     .collect(Collectors.toList());
        return collection.toArray(new String[collection.size()]);
    }
566739
public JcCollection<JcValue> asCollection() {
		JcCollection<JcValue> ret = new JcCollection<JcValue>(null, this, null);
		QueryRecorder.recordInvocationConditional(this, "asCollection", ret);
		return ret;
	}
787795
public T convert(Object value)
    {
        T result = null;
        if (value != null)
        {
            if (getValueClass().isInstance(value))
                result = getValueClass().cast(value);
            else
                result = convertFromString(value.toString());
        }
        return result;
    }
246267
public Collection<Object> getAll(String name) {
    Object value = get(name);
    if (value == null) {
      return Collections.emptySet();
    }
    if (value instanceof Collection<?>) {
      @SuppressWarnings("unchecked")
      Collection<Object> collectionValue = (Collection<Object>) value;
      return Collections.unmodifiableCollection(collectionValue);
    }
    return Collections.singleton(value);
  }
207239
@Override
    public Collection<Object> values() {
        ArrayList<Object> answer = new ArrayList<>(types.size());
        for (Iterator<Object> iter = valueIterator(); iter.hasNext(); ) {
            answer.add(iter.next());
        }
        return Collections.unmodifiableList(answer);
    }
1244636
public boolean isArray(Object value) {

        return value != null && (value.getClass().isArray() || value instanceof List);
    }
684372
public function transform($value): Collection
    {
        Assert::nullOrIsArray($value);

        if (empty($value)) {
            return new ArrayCollection();
        }

        return new ArrayCollection($this->taxonRepository->findBy(['code' => $value]));
    }
743965
public static Function<Object, Collection<?>> COLLECTION(final Class<? extends Collection> collectionType) {
      return as(new CollectionConverterImpl<>(collectionType, null));
   }
1251227
public Collection values()
    {
        if (values != null) return values;
        values = new AbstractCollection()
        {
            public int size()
            {
                return size;
            }

            public void clear()
            {
                ReferenceMap.this.clear();
            }

            public Iterator iterator()
            {
                return new ValueIterator();
            }
        };
        return values;
    }