Code example for Multiset

Methods: elementSet

    rules.add(new Rule(ruleDto.getKey(), ruleDto.getName()));
    return this;
  public Collection<Rule> rules() {
    return rules.elementSet();
  public int countRule(Rule rule) {
    return rules.count(rule);
  public static class Rule { 
    private RuleKey ruleKey;
    private String name;
    public Rule(RuleKey ruleKey, String name) {
      this.ruleKey = ruleKey; = name;
Connect your IDE to all the code out there  Get Codota for Java