private void pop(Deque<Item> stack) {
        Item rhs = stack.pop();
        Item lhs = stack.peek();
        switch (rhs.type) {
            case ADD -> lhs.exp = new AddFunction(lhs.exp, rhs.exp);
            case DIV -> lhs.exp = new DivFunction(lhs.exp, rhs.exp);
            case MOD -> lhs.exp = new ModFunction(lhs.exp, rhs.exp);
            case MUL -> lhs.exp = new MulFunction(lhs.exp, rhs.exp);
            case SUB -> lhs.exp = new SubFunction(lhs.exp, rhs.exp);
            default -> throw new UnsupportedOperationException("Operator " + rhs.type + " not supported.");
        }
    }
Converts the internal list of operator-expression pairs into a corresponding combined grouping expression. When
this method returns there is no residue of the conversion, and this object can be reused.

@return The grouping expression corresponding to the pushed arithmetic operations.
container-search/src/main/java/com/yahoo/search/grouping/request/MathResolver.java