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