This source file includes following definitions.
- newHashSet
- newArrayList
- newArrayList
package org.chromium.base;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
public final class CollectionUtil {
private CollectionUtil() {}
public static <E> HashSet<E> newHashSet(E... elements) {
HashSet<E> set = new HashSet<E>(elements.length);
Collections.addAll(set, elements);
return set;
}
public static <E> ArrayList<E> newArrayList(E... elements) {
ArrayList<E> list = new ArrayList<E>(elements.length);
Collections.addAll(list, elements);
return list;
}
public static <E> ArrayList<E> newArrayList(Iterable<E> iterable) {
ArrayList<E> list = new ArrayList<E>();
for (E element : iterable) {
list.add(element);
}
return list;
}