Returns a list back to the pool so that it can be re-used

@param list
772971
public synchronized void returnList(List list) {
        if (tc.isEntryEnabled())
            SibTr.entry(tc, "returnList");

        list.clear();
        listPool.add(list);

        if (tc.isEntryEnabled())
            SibTr.exit(tc, "returnList");
    }
964882
private static <T> List<T> unmodifiableList(List<T> list) {
        if (list == null) {
            return Collections.emptyList();
        }
        return Collections.unmodifiableList(list);
    }
223560
public static <T> T getLast(List<T> list) {
		if (isEmpty(list)) {
			return null;
		}

		return list.get(list.size() - 1);
	}
756870
public static <T> List<T> toList(Stream<T> stream) {
        return stream.collect(Collectors.<T>toList());
    }
691638
public static <T> Iterator<T> reverseIterator(final List<T> list) {
		return new Iterator<T>() {

			private int next = list.size() - 1;

			@Override
			@Pure
			public boolean hasNext() {
				return this.next >= 0;
			}

			@Override
			public T next() {
				final int n = this.next;
				--this.next;
				try {
					return list.get(n);
				} catch (IndexOutOfBoundsException exception) {
					throw new NoSuchElementException();
				}
			}

		};
	}
585634
public static List<Integer> asList (int[] list)
    {
        if (list == null) {
            return null;
        }
        List<Integer> ilist = new ArrayList<Integer>(list.length);
        for (int ii = 0; ii < list.length; ii++) {
            ilist.add(list[ii]);
        }
        return ilist;
    }
1078055
public static <T> T head(List<T> list)
	{
		if (list.isEmpty())
			return null;
		else
			return list.get(0);
	}
1092760
@Override
    public C.List<T> prepend(C.List<T> list) {
        return prependList(list);
    }
574428
private static List<Integer> convertList(List<String> list) {
        if (list == null) {
            return null;
        }
        List<Integer> ret = new ArrayList<Integer>(list.size());
        for (String v : list) {
            ret.add(StringUtils.toInt(v));
        }

        return ret;
    }
1347114
public static Object[] toArray(List<?> list) {
	Iterator<?> it = list.iterator();
	Class clazz = null;
	while (it.hasNext()) {
	    Object v = it.next();
	    if (v == null) continue;
	    if (clazz == null) clazz = v.getClass();
	    else if (clazz != v.getClass()) return list.toArray();
	}
	if (clazz == Object.class || clazz == null) return list.toArray();

	Object arr = java.lang.reflect.Array.newInstance(clazz, list.size());
	return list.toArray((Object[]) arr);
    }
1020586
@NonNull
  public static <T> List<T> immutableCopyOf(@Nullable List<T> list) {
    if (isNullOrEmpty(list)) {
      return Collections.emptyList();
    }
    return Collections.unmodifiableList(new ArrayList<>(list));
  }
936006
private static Object saveList(List<String> list) {
        if ((list == null) || list.isEmpty()) {
            return null;
        }

        int size = list.size();

        if (size == 1) {
            return list.get(0);
        }

        return list.toArray(new String[size]);
    }
213859
public static <T> List<T> merge(List<List<T>> list) {
        return list.stream().flatMap(Collection::stream).collect(Collectors.toList());
    }
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;
	}
853652
public static <T> T getLast(List<T> list)
    {
        if (list == null)
        {
            return null;
        }
        if (list instanceof RandomAccess)
        {
            return RandomAccessListIterate.getLast(list);
        }
        ListIterator<T> iterator = list.listIterator(list.size());
        if (iterator.hasPrevious())
        {
            return iterator.previous();
        }
        return null;
    }
980840
public static @Nonnull <T> List<T> unmodifiableList(@Nullable List<T> list) {
        if (isEmpty(list)) {
            return Collections.emptyList();
        }
        return Collections.unmodifiableList(list);
    }
1126632
public static <V> Map<V, V> convertListToMap(List<V> list) {
        Map<V, V> map = new HashMap<V, V>();
        if(list.size() % 2 != 0)
            throw new VoldemortException("Failed to convert list to map.");
        for(int i = 0; i < list.size(); i += 2) {
            map.put(list.get(i), list.get(i + 1));
        }
        return map;
    }