Returns the array value as a List.

@param value Array to convert into a list.

@return the array value as a List.
17285
private Object asList(Object value) {
        Class<?> componentClass = value.getClass().getComponentType();
        if (componentClass.isPrimitive()) {
            if (componentClass.equals(int.class)) {
                return asIntList(value);
            } else if (componentClass.equals(long.class)) {
                return asLongList(value);
            } else if (componentClass.equals(boolean.class)) {
                return asBooleanList(value);
            } else if (componentClass.equals(short.class)) {
                return asShortList(value);
            } else if (componentClass.equals(byte.class)) {
                return asByteList(value);
            } else {
                return asCharList(value);
            }
        } else {
            return asList(value, componentClass);
        }
    }
206525
private static JsonArray getJsonValueAsArray(JsonValue value) {
        return (value != null && value.getValueType() == ValueType.ARRAY) ? value.asJsonArray() : null;
    }
732661
public static function toArray($value)
    {
        if (is_array($value)) {
            return $value;
        }

        if ($value instanceof Collection) {
            return $value->all();
        }

        return [$value];
    }
59395
private Object[] convertToSingleElementArray(Object value) {
		final Object[] singleElementArray = ArrayUtil.newArray(targetComponentType, 1);
		singleElementArray[0] = ConverterRegistry.getInstance().convert(targetComponentType, value);
		return singleElementArray;
	}
1231735
public static <V extends Value> ValueList<V> getInstance(V... value) {
        ValueList<V> result = new ValueList<>(value.length);
        for (V val : value) {
            result.add(val);
        }
        return result;
    }
307983
public static JCalValue object(ListMultimap<String, Object> value) {
		Map<String, JsonValue> object = new LinkedHashMap<String, JsonValue>();
		for (Map.Entry<String, List<Object>> entry : value) {
			String key = entry.getKey();
			List<Object> list = entry.getValue();

			JsonValue v;
			if (list.size() == 1) {
				v = new JsonValue(list.get(0));
			} else {
				List<JsonValue> array = new ArrayList<JsonValue>(list.size());
				for (Object element : list) {
					array.add(new JsonValue(element));
				}
				v = new JsonValue(array);
			}
			object.put(key, v);
		}
		return new JCalValue(new JsonValue(object));
	}
370798
static List<String> extractAsArrayOfClassName(String value) {
		Matcher matcher = classPattern.matcher(value);

		List<String> result = new ArrayList<String>();

		while (matcher.find()) {
			result.add(matcher.group(1));
		}

		return result;
	}
107117
public Collection<String> split(String value) {
    String[] parts = splitter.split(value);
    Collection<String> values = new ArrayList(parts.length);
    for (int ix = 0; ix < parts.length; ix++)
      values.add(parts[ix]);
    return values;
  }

  public String getSplitOn() {
	return splitter.toString();
  }
}
390002
private List<Short> asShortList(Object value) {
        short[] values = (short[]) value;
        List<Short> list = new ArrayList<Short>(values.length);
        for (short shortValue : values) {
            list.add(shortValue);
        }
        return list;
    }
801784
public static Object[] stringListToArray(List<String> list) {
		Object[] params = null;
		if (list != null) {
			params = list.toArray(new String[list.size()]);
		}
		return params;
	}
776712
public static <E> List<E> newArrayList(E... values) {
    List<E> list = new ArrayList<E>(values.length);
    for (E e : values) {
      list.add(e);
    }
    return list;
  }
465609
@SafeVarargs
    public static <T> ArrayList<T> getArrayList(int capacity, T... values) {
        return new ArrayList<T>(capacity) {{addAll(Arrays.asList(values));}};
    }
367804
public static Collection<String> split(final String value) {
        if (value == null) {
            return Collections.emptyList();
        }
        final String[] tokens = value.trim().split("\\s+");
        return asList(tokens);
    }
1213020
public static <T> List<T> arrayToList(T [] array) {
        return new ArrayList<T>(Arrays.asList(array));
    }
41408
public static <T> T[] toArray(List<T> list) {
        T[] toR = (T[]) Array.newInstance(list.get(0).getClass(), list.size());
        for (int i = 0; i < list.size(); i++) {
            toR[i] = list.get(i);
        }
        return toR;
    }
392679
private static double[] toArray(List<Double> list) {
    double[] values = new double[list.size()];
    for (int i = 0; i < values.length; i++) {
      values[i] = list.get(i);
    }
    return values;
  }
292257
public static <T> T[] toArray(List<T> list) {
    return toArray(getClass(list.get(0)), list);
  }