private boolean checkRuleMatch(ACLRule newRule){
  List<Integer> allowRuleList=new ArrayList<>();
  for (  ACLRule existingRule : getRules()) {
    if (newRule.match(existingRule)) {
      return true;
    }
    if (existingRule.getAction() == Action.ALLOW && newRule.getAction() == Action.DENY) {
      if (existingRule.match(newRule)) {
        allowRuleList.add(existingRule.getId());
      }
    }
  }
  deny2Allow.put(newRule.getId(),allowRuleList);
  return false;
}

private boolean checkRuleMatch ( ACLRule newRule ) { List < Integer > allowRuleList = new ArrayList < > ( ) ; for ( ACLRule existingRule : getRules ( ) ) { if ( newRule . match ( existingRule ) ) { return true ; } if ( existingRule . getAction ( ) == Action . ALLOW && newRule . getAction ( ) == Action . DENY ) { if ( existingRule . match ( newRule ) ) { allowRuleList . add ( existingRule . getId ( ) ) ; } } } deny2Allow . put ( newRule . getId ( ) , allowRuleList ) ; return false ; }
checks if the new acl rule matches an existing rule . if existing allowing rules matches the new denying rule , store the mappings .
