Code example for Multiset

Methods: elementSet

0
    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;
      this.name = name;