254255256257258259260261262263264
IntBag bag = (IntBag) obj; if (bag.size() != 1) { return false; } return this.occurrencesOf(this.element1) == bag.occurrencesOf(this.element1); } @Override public int hashCode() {
493494495496497498499500501502503
return this.items.keysView().allSatisfy(new IntPredicate() { public boolean accept(int key) { return IntHashBag.this.occurrencesOf(key) == bag.occurrencesOf(key); } }); } @Override