Code example for Multiset

Methods: elementSetaddAll

0
        counts.add(event, i);
        total = counts.elementSet().size();
    } 
 
    public void addAll(Collection<T> events) {
        counts.addAll(events);
        total = counts.elementSet().size();
    } 
 
    public int count(T event) {
        return counts.count(event);
    } 
 
    @Override 
    public float prob(T event) {
        if (total == 0) {
            return epsilon(); 
        } 
        return ((float)counts.count(event)) / total;
    } 
Connect your IDE to all the code out there  Get Codota for Java