public <T> ImmutableBag<T> withAll(Iterable<? extends T> items) {
    if (items instanceof ImmutableBag<?>) {
      return (ImmutableBag<T>) items;
    }

    return this.of((T[]) Iterate.toArray(items));
  }
Esempio n. 2
0
 public static <E> ImmutableArrayList<E> newList(Iterable<? extends E> iterable) {
   return new ImmutableArrayList<E>((E[]) Iterate.toArray(iterable));
 }