Applies a function to every item in a list.
@param list      the list with values
@param f         closure to apply
@param <From>    value type
@param <To>      destination type
@return list of transformed values
975804
@SuppressWarnings("unchecked")
    public static <From, To> List<To> map(List<From> list, MapClosure<From,To> f) {
        List<To> result = new ArrayList<To>(list.size());
        for (From value : list) {
            result.add( f.eval(value) );
        }
        return result;
    }
728901
@MapMethod
    public Map<String,Object> iterate(Map<String,Object> o, final ScriptFunction f){
        return Objects.iterate(o,new Closure<ObjectIterator.IterateBean, Object>() {
            @Override
            public Object call(ObjectIterator.IterateBean input) {
                return f.call(Objects.newHashMap(String.class,Object.class,
                        "path",input.getPath(),
                        "value",input.getValue(),
                        "name",input.getName()
                        ));
            }
        });
    }
274865
function each(list, fn) {
  var len = list ? list.length : 0;
  var i = 0;
  for (; i < len; ++i) {
    fn(list[i], i);
  }
  return list
}
1185874
public static final <T> Function<T,List<T>> intoSingletonListOf(final Type<T> type) {
        return new IntoSingletonList<T>();
    }
139650
private Function getMergedByAND(List<Function> list) {
		Iterator<Function> iterAND = list.iterator();
		Function mergedConditions = iterAND.next();
		while (iterAND.hasNext()) {
			Function e = iterAND.next();
			mergedConditions = termFactory.getFunctionAND(e, mergedConditions);
		}		
		return mergedConditions;
	}
552229
@Override
    public <B> ListT<W,B> map(final Function<? super T, ? extends B> f) {
        return of(run.map(o -> o.map(f)));
    }
813013
function map(fn, list) {

   return list
            ? cons(fn(head(list)), map(fn,tail(list)))
            : emptyList
            ;
}
726833
@Inline(value="$2.$3copyOf($1)", imported=ImmutableList.class)
	public static <T> List<T> immutableCopy(List<? extends T> list) {
		return ImmutableList.copyOf(list);
	}
817298
public static final <S, E> Functional<S> functionalList(List<E> list) {
		return new FunctionalList<S, E>(list); 
	}
59051
public static <T> List<T> immutableListView(List<T> list) {
        if (list instanceof ImmutableList<?>) {
            return list;
        }
        if (list instanceof ArrayList<?>) {
            ArrayList.class.cast(list).trimToSize();
        }
        return Collections.unmodifiableList(list);
    }
715268
public static <T, E extends Exception> FloatList mapToFloat(final Collection<? extends T> c, final int fromIndex, final int toIndex,
            final Try.ToFloatFunction<? super T, E> func) throws E {
        checkFromToIndex(fromIndex, toIndex, size(c));
        N.checkArgNotNull(func);

        if (N.isNullOrEmpty(c) && fromIndex == 0 && toIndex == 0) {
            return new FloatList();
        }

        final FloatList result = new FloatList(toIndex - fromIndex);

        if (c instanceof List && c instanceof RandomAccess) {
            final List<T> list = (List<T>) c;

            for (int i = fromIndex; i < toIndex; i++) {
                result.add(func.applyAsFloat(list.get(i)));
            }
        } else {
            int idx = 0;

            for (T e : c) {
                if (idx++ < fromIndex) {
                    continue;
                }

                result.add(func.applyAsFloat(e));

                if (idx >= toIndex) {
                    break;
                }
            }
        }

        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 );
	}
724345
public static <T, K> boolean moveUp(List<T> list, K key,
			Function<T, K> keyMapper, int n) {
		if (list == null)
			return false;
		ArrayList<T> newList = new ArrayList<T>();
		boolean changed = false;
		for (int i = 0; i < list.size(); i++) {
			T item = list.get(i);

			if (i > 0 && key.equals(keyMapper.apply(item))) {
				int posi = i - n;
				if (posi < 0)
					posi = 0;
				newList.add(posi, item);
				changed = true;
			} else
				newList.add(item);
		}

		if (changed) {
			list.clear();
			list.addAll(newList);
			return true;
		}
		return false;
	}
1298604
function listToArray(list) {
  if(isFunction(list)) {
    return function(x) {
      const m = list(x)

      if(!isSameType(List, m)) {
        throw new TypeError('listToArray: List returning function required')
      }

      return m.toArray()
    }
  }

  if(isSameType(List, list)) {
    return list.toArray()
  }

  throw new TypeError('listToArray: List or List returning function required')
}
675698
public static <T, R> List<R> transformList(Collection<T> collection,
            Function<T, R> transformFunction) {
        return collection.stream().map(transformFunction).collect(toList());
    }
114571
public static <T extends Comparable<? super T>> List<T> sortInplace(List<T> list) {
		Collections.sort(list);
		return list;
	}
1148589
@VisibleForTesting
    int getValueFromList(final List<Integer> values, int index, final AtomicInteger shift) {
        Preconditions.checkNotNullNorEmpty(values, "List must not be empty");
        if (index < 0) {
            index = index + values.size();
            shift.incrementAndGet();
            return getValueFromList(values, index, shift);
        }
        if (index >= values.size()) {
            index = index - values.size();
            shift.incrementAndGet();
            return getValueFromList(values, index, shift);
        }
        return values.get(index);
    }