private static boolean removeExactMatchCoveredExpressions ( AbstractExpression coveringExpr , List < AbstractExpression > exprsToCover ) { boolean hasMatch = false ; Iterator < AbstractExpression > iter = exprsToCover . iterator ( ) ; while ( iter . hasNext ( ) ) { AbstractExpression exprToCover = iter . next ( ) ; if ( coveringExpr . bindingToIndexedExpression ( exprToCover ) != null ) { iter . remove ( ) ; hasMatch = true ; // need to keep going to remove all matches } } return hasMatch ; }
Loop over the expressions to cover to find ones that exactly match the covering expression and remove them from the original list . Returns true if there is at least one match . False otherwise .