public ImmutableBag<T> newWithAll(Iterable<? extends T> elements) { return Iterate.addAllTo(elements, HashBag.newBag(this.delegate)).toImmutable(); }
public ImmutableBag<T> newWith(T element) { return HashBag.newBag(this.delegate).with(element).toImmutable(); }
public ImmutableBag<T> newWithout(T element) { HashBag<T> hashBag = HashBag.newBag(this.delegate); hashBag.remove(element); return hashBag.toImmutable(); }
public ImmutableHashBag(Bag<? extends T> source) { this.delegate = HashBag.newBag(source); }