private static void replaceInListFilterWithEqualityFilter ( List < AbstractExpression > endExprs , AbstractExpression inListRhs , AbstractExpression equalityRhs ) { for ( AbstractExpression comparator : endExprs ) { AbstractExpression otherExpr = comparator . getRight ( ) ; if ( otherExpr == inListRhs ) { endExprs . remove ( comparator ) ; AbstractExpression replacement = new ComparisonExpression ( ExpressionType . COMPARE_EQUAL , comparator . getLeft ( ) , equalityRhs ) ; endExprs . add ( replacement ) ; break ; } } }
with an equality filter referencing the second given rhs .