/* list -> array
4937
public DataArray array(File[] files, int start, int count) {
		return STRUCT.fromMapsAndCollections(list(files, start, count));
	}
1099778
private String[] parseStringArray(final String list) {
		StringTokenizer tokenizer = new StringTokenizer(list, ",", false);
		int length = tokenizer.countTokens();
		String[] arr = new String[length];

		for (int i = 0; tokenizer.hasMoreElements(); i++) {
			arr[i] = cleanSpaces(tokenizer.nextToken());
		}

		return arr;
	}
295748
public static <T> List<T> addAll(int index, List<T> list, T... array)
    {
        for (T item : array)
        {
            list.add(index++, item);
        }
        return list;
    }
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;
  }
512354
public static <T> List<T> toList(Object array, Class<T> clazz) {
        List<T> list = new ArrayList<>();
        for (Object o : toObjectArray(array)) {
            list.add(Reflection.toType(o, clazz));
        }
        return list;
    }
1082460
function(list) {
            if (isArray(list.value)) {
                list.value = list.value.reverse();
            }

            return list;
        }
849757
public static String[] toArray(List<String> list) {
        String[] ret = new String[list.size()];
        for (int i = 0; i < ret.length; i++)
            ret[i] = list.get(i);
        return ret;
    }
870073
function arrays() {
		extend(Array, {
			every: function every(array, fun, thisp) {
				var res = true,
					len = array.length >>> 0;
				for (var i = 0; i < len; i++) {
					if (array[i] !== undefined) {
						if (!fun.call(thisp, array[i], i, array)) {
							res = false;
							break;
						}
					}
				}
				return res;
			},
			forEach: function forEach(array, fun, thisp) {
				var len = array.length >>> 0;
				for (var i = 0; i < len; i++) {
					if (array[i] !== undefined) {
						fun.call(thisp, array[i], i, array);
					}
				}
			},
			map: function map(array, fun, thisp) {
				var m = [],
					len = array.length >>> 0;
				for (var i = 0; i < len; i++) {
					if (array[i] !== undefined) {
						m.push(fun.call(thisp, array[i], i, array));
					}
				}
				return m;
			},
			filter: function map(array, fun, thisp) {
				return Array.prototype.filter.call(array, fun, thisp);
			},
			isArray: function isArray(o) {
				return Object.prototype.toString.call(o) === "[object Array]";
			},
			concat: function(a1, a2) {
				function map(e) {
					return e;
				}
				return this.map(a1, map).concat(this.map(a2, map));
			}
		});
	}
414956
function arrayToMap(array) {
    var result = {}
    array.forEach(function(v) {
        result[v] = true
    })
    return result
}
794099
private function parseList($list)
    {
        if(null === $this->fields)
        {
            return $list;
        }
        $result = [];
        foreach($list as $item)
        {
            if(is_object($item))
            {
                $item = clone $item;
            }
            ObjectArrayHelper::filter($item, $this->fields, $this->mode);
            $result[] = $item;
        }
        return $result;
    }
829850
function(list){
		var type = typeof list;
		if(type === "string" || Array.isArray(list)) {
			return true;
		}
		var length = list && (type !== 'boolean' && type !== 'number' && "length" in list) && list.length;

		// var length = "length" in obj && obj.length;
		return typeof list !== "function" &&
			( length === 0 || typeof length === "number" && length > 0 && ( length - 1 ) in list );
	}
275910
function tree(list) {
  const mapped = {}; // { id: name } 形式方便取值

  list.forEach((it) => {
    mapped[it.id] = it;
  });

  const result = [];

  list.forEach((it) => {
    if (it.pid === '') {
      result.push(it);
    } else {
      const parent = mapped[it.pid];
      if (parent) {
        if (!parent.children) {
          parent.children = [];
        }
        parent.children.push(it);
      }
    }
  });

  return result;
}
1092760
@Override
    public C.List<T> prepend(C.List<T> list) {
        return prependList(list);
    }
842488
function(list, name) {
    if (Object.prototype.toString.call(list) === '[object Array]' && Object.prototype.toString.call(name) === '[object String]') {
      for (var i = 0; i < list.length; i++) {
        if (list[i] === name) {
          return true;
        }
      }
    }
    return false;
  }
245905
protected <T> List<T> toArrayList(List<T> list) {
        if (list == null) {
            return null;
        }
        if (!list.getClass().equals(ArrayList.class)) {
            list = new ArrayList<>(list);
        }
        return list;
    }
649727
public static List<Integer> asList(int[] array) {
    List<Integer> l = new ArrayList<Integer>();
    for (int i : array) {
      l.add(i);
    }
    return l;
  }
358595
public static ArrayList<String> toList( String[] array )
	{
		if( array == null )
		{
			return new ArrayList<String>( 0 );
		}
		ArrayList<String> list = new ArrayList<String>( array.length );
		for (String s : array)
		{
			list.add( s );
		}
		return list;
	}