class DefaultStreamEffector implements StreamEffector {
    private final String expr;
    private boolean done = false;
    private boolean effect = false;
    private int explainIndex = -1;

    public DefaultStreamEffector(String expr) {
        this.expr = expr;
    }

    @Override
    public StreamEffectorResult current() {
        return new DefaultStreamEffectorResult(effect, done, explainIndex);
    }

    @Override
    public boolean push(Effect eft, int currentIndex, int policySize) {<FILL_FUNCTION_BODY>}
}

        switch (this.expr) {
            case "some(where (p_eft == allow))":
                if (eft == Effect.Allow) {
                    this.effect = true;
                    explainIndex = currentIndex;
                    this.done = true;
                }
                break;
            case "!some(where (p_eft == deny))":
                this.effect = true;
                if (eft == Effect.Deny) {
                    this.effect = false;
                    explainIndex = currentIndex;
                    this.done = true;
                }
                break;
            case "some(where (p_eft == allow)) && !some(where (p_eft == deny))":
                if (eft == Effect.Allow) {
                    this.effect = true;
                    explainIndex = explainIndex == -1 ? currentIndex : explainIndex;
                } else if (eft == Effect.Deny) {
                    this.effect = false;
                    explainIndex = currentIndex;
                    this.done = true;
                }
                break;
            case "priority(p_eft) || deny":
            case "subjectPriority(p_eft) || deny":
                if (eft != Effect.Indeterminate) {
                    this.effect = eft == Effect.Allow;
                    explainIndex = currentIndex;
                    this.done = true;
                }
                break;
            default:
                throw new UnsupportedOperationException("unsupported effect");
        }

        return this.done;
    
<no_super_class>