[ https://issues.apache.org/jira/browse/COLLECTIONS-709?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Robert Wertman closed COLLECTIONS-709. -------------------------------------- > MultiSet.Entry::getCount() isn't 0 after removing the last element > ------------------------------------------------------------------ > > Key: COLLECTIONS-709 > URL: https://issues.apache.org/jira/browse/COLLECTIONS-709 > Project: Commons Collections > Issue Type: Bug > Affects Versions: 4.1, 4.2 > Reporter: Robert Wertman > Priority: Minor > Fix For: 4.3 > > Time Spent: 0.5h > Remaining Estimate: 0h > > Removing the final element(s) in a MultiSet doesn't set the count on a > MultiSet.Entry to zero. > {code:java} > protected int getCountAfterRemoval(MultiSet<String> multiset) { > MultiSet.Entry<String> entry = multiset.entrySet().iterator().next(); > entry.getCount(); // = 2 > multiset.remove(entry.getElement()); > entry.getCount(); // = 1 > multiset.remove(entry.getElement()); > return entry.getCount(); // Still = 1, should be 0 > } > {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)