public void wipeZeros() {
        Set<T> objToBeRemoved = new HashSet<T>();
        for (T obj : objToCounts.keySet()) {
            if (shouldBeRemovedFromCounter(obj)) {
                objToBeRemoved.add(obj);
            }
        }
        for (T obj : objToBeRemoved) {
            objToCounts.remove(obj);
        }
    }
public void wipeZeros ( ) { Set < T > objToBeRemoved = new HashSet < T > ( ) ; for ( T obj : objToCounts . keySet ( ) ) { if ( shouldBeRemovedFromCounter ( obj ) ) { objToBeRemoved . add ( obj ) ; } } for ( T obj : objToBeRemoved ) { objToCounts . remove ( obj ) ; } }
Remove any object from the counter whose total count is zero (to free up
memory).