Returns an ArrayListImpl that is safe to modify. If delegate.count does not equal to zero,
returns a copy of delegate.
179565
private ArrayListImpl<ChildLink<T>> modifiableDelegate() {
    if (delegate.getCount() != 0) {
      delegate = new ArrayListImpl<>(delegate);
    }
    return delegate;
  }
708753
public static <E> List<E> copyOf(Iterable<? extends E> elements) {
    Preconditions.checkNotNull(elements, "elements");
    List<E> result = (elements instanceof Collection)
        // can pre-allocate the array
        ? new ArrayList<>(cast(elements).size())
        // cannot
        : new ArrayList<>();
    for (E e : elements) {
      result.add(e);
    }
    return Collections.unmodifiableList(result);
  }
772521
private int getByteCount(ArrayList<byte[]> listOfByteArrays) {
        int count = 0;
        for (byte[] byteArray : listOfByteArrays) {
            if (byteArray != null) {
                count += byteArray.length;
            }
        }
        return count;
    }
655058
private final IterableSubject delegate() {
    IterableSubject delegate = check().that(actual());
    if (internalCustomName() != null) {
      delegate = delegate.named(internalCustomName());
    }
    return delegate;
  }
773917
List<? extends E> list() {
		List<E> result = new ArrayList<E>();
		while (hasNext()) {
			result.add(next());
		}
		return result;
	}
523321
private static void collectAllAnonymous(List<IType> list, IParent parent, boolean allowNested) throws JavaModelException {
        IJavaElement[] children = parent.getChildren();
        for (int i = 0; i < children.length; i++) {
            IJavaElement childElem = children[i];
            if (isAnonymousType(childElem)) {
                list.add((IType) childElem);
            }
            if (childElem instanceof IParent) {
                if (allowNested || !(childElem instanceof IType)) {
                    collectAllAnonymous(list, (IParent) childElem, allowNested);
                }
            }
        }
    }
977615
@Nonnull
    public final ArrayList<A> toArrayList() {
        ArrayList<A> list = new ArrayList<>(this.length);
        ImmutableList<A> l = this;
        for (int i = 0; i < length; i++) {
            list.add(((NonEmptyImmutableList<A>) l).head);
            l = ((NonEmptyImmutableList<A>) l).tail;
        }
        return list;
    }
903083
function () {
            var delegate = THIS[ this.hash ],
                i,
                len = delegate.activePointersLists.length,
                count = 0;

            for ( i = 0; i < len; i++ ) {
                count += delegate.activePointersLists[ i ].getLength();
            }

            return count;
        }
791669
@SuppressWarnings({"rawtypes", "unchecked"})
    public static List getCloneList(List sourceList) {
        if (null == sourceList) {
            return null;
        }
        List targetList = new ArrayList();
        for (int i = 0; i < sourceList.size(); i++) {
            Object target = null;
            Object source = sourceList.get(i);
            try {
                Constructor con = source.getClass().getConstructor();
                target = con.newInstance();
                PropertyUtils.copyProperties(target, source);
            } catch (Exception e) {
                logger.error("clone object exception object class:" + source.getClass(), e);
            }
            targetList.add(target);
        }
        return targetList;
    }
774811
private static Object getDataFromList(List dataList,int index){
		int size=dataList.size();
		while(size<index+1){
			dataList.add(new HashMap());
			size=dataList.size();
		}
		Object retObj=dataList.get(index);
		return retObj;
	}
20115
public static InsnList cloneList(InsnList list)
	{
		InsnList clone = new InsnList();
		ListIterator<AbstractInsnNode> it = list.iterator();
		while (it.hasNext())
			clone.add(it.next().clone(Collections.emptyMap()));

		return clone;
	}
787839
private Object manageListIfNecessary(List<Object> value) {
		boolean containsRuntimeRefs = false;
		for (ListIterator<Object> i = value.listIterator(); i.hasNext();) {
			Object e = i.next();
			if(e instanceof RuntimeBeanReference) {
				containsRuntimeRefs = true;
			}
            if (e instanceof BeanConfiguration) {
                BeanConfiguration c = (BeanConfiguration) e;
                i.set(c.getBeanDefinition());
                containsRuntimeRefs = true;
            }
        }
		if(containsRuntimeRefs) {
			List tmp = new ManagedList();
			tmp.addAll(value);
			value = tmp;
		}
		return value;
	}
806014
@Override
    public List getPatternList() {
        ExtensionFactory delegate = this.delegate;
        if (delegate != null)
            return delegate.getPatternList();
        return Collections.emptyList();
    }
1189485
public final Ix<Object[]> collectToArray() {
        return collect(ToListHelper.<T>initialFactory(), ToListHelper.<T>collector())
                .map(ToListHelper.<T>toArray());
    }
1183801
@SuppressWarnings({ "unchecked", "rawtypes" })
	public static List<Object> arrayAsList(Object value) {
		if (value instanceof List) {
			return (List<Object>) value;
		}
		List list = null;
		if (value instanceof int[]) {
			list = new ArrayList();
			int[] array = (int[]) value;
			for (int i : array) {
				list.add(i);
			}
		} else if (value instanceof short[]) {
			list = new ArrayList();
			short[] array = (short[]) value;
			for (short i : array) {
				list.add(i);
			}
		} else if (value instanceof char[]) {
			list = new ArrayList();
			char[] array = (char[]) value;
			for (char i : array) {
				list.add(i);
			}
		} else if (value instanceof byte[]) {
			list = new ArrayList();
			byte[] array = (byte[]) value;
			for (byte i : array) {
				list.add(i);
			}
		} else if (value instanceof long[]) {
			list = new ArrayList();
			long[] array = (long[]) value;
			for (long i : array) {
				list.add(i);
			}
		} else if (value instanceof double[]) {
			list = new ArrayList();
			double[] array = (double[]) value;
			for (double i : array) {
				list.add(i);
			}
		} else if (value instanceof float[]) {
			list = new ArrayList();
			float[] array = (float[]) value;
			for (float i : array) {
				list.add(i);
			}
		} else if (value instanceof boolean[]) {
			list = new ArrayList();
			boolean[] array = (boolean[]) value;
			for (boolean i : array) {
				list.add(i);
			}
		} else if (value.getClass().isArray()) {
			Object[] array = (Object[]) value;
			list = Arrays.asList(array);
		}
		return list;
	}
759150
@NonNull
    @Override
    public List<Object> toList() {
        final List<Object> array = new ArrayList<>();
        for (int i = 0; i < count(); i++) {
            array.add(values.get(i).asObject());
        }
        return array;
    }
616509
public static Expression asImmutableList(Iterable<? extends Expression> items) {
    ImmutableList<Expression> copy = ImmutableList.copyOf(items);
    if (copy.size() < MethodRef.IMMUTABLE_LIST_OF.size()) {
      return MethodRef.IMMUTABLE_LIST_OF.get(copy.size()).invoke(copy);
    }
    ImmutableList<Expression> explicit = copy.subList(0, MethodRef.IMMUTABLE_LIST_OF.size());
    Expression remainder =
        asArray(OBJECT_ARRAY_TYPE, copy.subList(MethodRef.IMMUTABLE_LIST_OF.size(), copy.size()));
    return MethodRef.IMMUTABLE_LIST_OF_ARRAY.invoke(
        Iterables.concat(explicit, ImmutableList.of(remainder)));
  }