class ForEachStmt extends Statement implements NodeWithBody<ForEachStmt> {

    private VariableDeclarationExpr variable;

    private Expression iterable;

    private Statement body;

    public ForEachStmt() {
        this(null, new VariableDeclarationExpr(), new NameExpr(), new ReturnStmt());
    }

    @AllFieldsConstructor
    public ForEachStmt(final VariableDeclarationExpr variable, final Expression iterable, final Statement body) {
        this(null, variable, iterable, body);
    }

    /**
     * This constructor is used by the parser and is considered private.
     */
    @Generated("com.github.javaparser.generator.core.node.MainConstructorGenerator")
    public ForEachStmt(TokenRange tokenRange, VariableDeclarationExpr variable, Expression iterable, Statement body) {
        super(tokenRange);
        setVariable(variable);
        setIterable(iterable);
        setBody(body);
        customInitialization();
    }

    public ForEachStmt(VariableDeclarationExpr variable, String iterable, BlockStmt body) {
        this(null, variable, new NameExpr(iterable), body);
    }

    @Override
    @Generated("com.github.javaparser.generator.core.node.AcceptGenerator")
    public <R, A> R accept(final GenericVisitor<R, A> v, final A arg) {
        return v.visit(this, arg);
    }

    @Override
    @Generated("com.github.javaparser.generator.core.node.AcceptGenerator")
    public <A> void accept(final VoidVisitor<A> v, final A arg) {
        v.visit(this, arg);
    }

    @Generated("com.github.javaparser.generator.core.node.PropertyGenerator")
    public Statement getBody() {
        return body;
    }

    @Generated("com.github.javaparser.generator.core.node.PropertyGenerator")
    public Expression getIterable() {
        return iterable;
    }

    @Generated("com.github.javaparser.generator.core.node.PropertyGenerator")
    public VariableDeclarationExpr getVariable() {
        return variable;
    }

    @Generated("com.github.javaparser.generator.core.node.PropertyGenerator")
    public ForEachStmt setBody(final Statement body) {
        assertNotNull(body);
        if (body == this.body) {
            return this;
        }
        notifyPropertyChange(ObservableProperty.BODY, this.body, body);
        if (this.body != null)
            this.body.setParentNode(null);
        this.body = body;
        setAsParentNodeOf(body);
        return this;
    }

    @Generated("com.github.javaparser.generator.core.node.PropertyGenerator")
    public ForEachStmt setIterable(final Expression iterable) {
        assertNotNull(iterable);
        if (iterable == this.iterable) {
            return this;
        }
        notifyPropertyChange(ObservableProperty.ITERABLE, this.iterable, iterable);
        if (this.iterable != null)
            this.iterable.setParentNode(null);
        this.iterable = iterable;
        setAsParentNodeOf(iterable);
        return this;
    }

    @Generated("com.github.javaparser.generator.core.node.PropertyGenerator")
    public ForEachStmt setVariable(final VariableDeclarationExpr variable) {
        assertNotNull(variable);
        if (variable == this.variable) {
            return this;
        }
        notifyPropertyChange(ObservableProperty.VARIABLE, this.variable, variable);
        if (this.variable != null)
            this.variable.setParentNode(null);
        this.variable = variable;
        setAsParentNodeOf(variable);
        return this;
    }

    /**
     * Convenience method that directly returns this foreach statement's single variable declarator.
     * Note that any foreach statement's variable declaration expression (as returned by {@link #getVariable()}) always
     * has exactly one variable declarator.
     * <p>
     * Calling this method on a foreach statement {@code forEachStmt} is equivalent to calling
     * {@code forEachStmt.getVariable().getVariable(0)}.
     *
     * @return this foreach statement's single variable declarator.
     */
    public VariableDeclarator getVariableDeclarator() {
        return getVariable().getVariable(0);
    }

    /**
     * Convenience method that decides whether this foreach statement's variable is {@code final}.
     * Note that any foreach statement's variable declaration expression (as returned by {@link #getVariable()}) always
     * has either no modifiers, or a single {@code final} modifier.
     * <p>
     * Calling this method on a foreach statement {@code forEachStmt} is equivalent to calling
     * {@code forEachStmt.getVariable().getModifiers().isNonEmpty() &&
     * forEachStmt.getVariable().getModifiers().get(0).getKeyword() == Modifier.Keyword.FINAL}.
     *
     * @return {@code true} if this foreach statement's variable is {@code final}, and {@code false} otherwise.
     */
    public boolean hasFinalVariable() {
        return getVariable().getModifiers().isNonEmpty() && getVariable().getModifiers().get(0).getKeyword() == Modifier.Keyword.FINAL;
    }

    @Override
    @Generated("com.github.javaparser.generator.core.node.CloneGenerator")
    public ForEachStmt clone() {
        return (ForEachStmt) accept(new CloneVisitor(), null);
    }

    @Override
    @Generated("com.github.javaparser.generator.core.node.ReplaceMethodGenerator")
    public boolean replace(Node node, Node replacementNode) {<FILL_FUNCTION_BODY>}

    @Override
    @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
    public boolean isForEachStmt() {
        return true;
    }

    @Override
    @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
    public ForEachStmt asForEachStmt() {
        return this;
    }

    @Override
    @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
    public Optional<ForEachStmt> toForEachStmt() {
        return Optional.of(this);
    }

    @Override
    @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
    public void ifForEachStmt(Consumer<ForEachStmt> action) {
        action.accept(this);
    }

    @Override
    @Generated("com.github.javaparser.generator.core.node.GetMetaModelGenerator")
    public ForEachStmtMetaModel getMetaModel() {
        return JavaParserMetaModel.forEachStmtMetaModel;
    }
}

        if (node == null) {
            return false;
        }
        if (node == body) {
            setBody((Statement) replacementNode);
            return true;
        }
        if (node == iterable) {
            setIterable((Expression) replacementNode);
            return true;
        }
        if (node == variable) {
            setVariable((VariableDeclarationExpr) replacementNode);
            return true;
        }
        return super.replace(node, replacementNode);
    
<methods>public void <init>() ,public void <init>(com.github.javaparser.TokenRange) ,public com.github.javaparser.ast.stmt.AssertStmt asAssertStmt() ,public com.github.javaparser.ast.stmt.BlockStmt asBlockStmt() ,public com.github.javaparser.ast.stmt.BreakStmt asBreakStmt() ,public com.github.javaparser.ast.stmt.ContinueStmt asContinueStmt() ,public com.github.javaparser.ast.stmt.DoStmt asDoStmt() ,public com.github.javaparser.ast.stmt.EmptyStmt asEmptyStmt() ,public com.github.javaparser.ast.stmt.ExplicitConstructorInvocationStmt asExplicitConstructorInvocationStmt() ,public com.github.javaparser.ast.stmt.ExpressionStmt asExpressionStmt() ,public com.github.javaparser.ast.stmt.ForEachStmt asForEachStmt() ,public com.github.javaparser.ast.stmt.ForStmt asForStmt() ,public com.github.javaparser.ast.stmt.IfStmt asIfStmt() ,public com.github.javaparser.ast.stmt.LabeledStmt asLabeledStmt() ,public com.github.javaparser.ast.stmt.LocalClassDeclarationStmt asLocalClassDeclarationStmt() ,public com.github.javaparser.ast.stmt.LocalRecordDeclarationStmt asLocalRecordDeclarationStmt() ,public com.github.javaparser.ast.stmt.ReturnStmt asReturnStmt() ,public com.github.javaparser.ast.stmt.SwitchStmt asSwitchStmt() ,public com.github.javaparser.ast.stmt.SynchronizedStmt asSynchronizedStmt() ,public com.github.javaparser.ast.stmt.ThrowStmt asThrowStmt() ,public com.github.javaparser.ast.stmt.TryStmt asTryStmt() ,public com.github.javaparser.ast.stmt.UnparsableStmt asUnparsableStmt() ,public com.github.javaparser.ast.stmt.WhileStmt asWhileStmt() ,public com.github.javaparser.ast.stmt.YieldStmt asYieldStmt() ,public com.github.javaparser.ast.stmt.Statement clone() ,public com.github.javaparser.metamodel.StatementMetaModel getMetaModel() ,public void ifAssertStmt(Consumer<com.github.javaparser.ast.stmt.AssertStmt>) ,public void ifBlockStmt(Consumer<com.github.javaparser.ast.stmt.BlockStmt>) ,public void ifBreakStmt(Consumer<com.github.javaparser.ast.stmt.BreakStmt>) ,public void ifContinueStmt(Consumer<com.github.javaparser.ast.stmt.ContinueStmt>) ,public void ifDoStmt(Consumer<com.github.javaparser.ast.stmt.DoStmt>) ,public void ifEmptyStmt(Consumer<com.github.javaparser.ast.stmt.EmptyStmt>) ,public void ifExplicitConstructorInvocationStmt(Consumer<com.github.javaparser.ast.stmt.ExplicitConstructorInvocationStmt>) ,public void ifExpressionStmt(Consumer<com.github.javaparser.ast.stmt.ExpressionStmt>) ,public void ifForEachStmt(Consumer<com.github.javaparser.ast.stmt.ForEachStmt>) ,public void ifForStmt(Consumer<com.github.javaparser.ast.stmt.ForStmt>) ,public void ifIfStmt(Consumer<com.github.javaparser.ast.stmt.IfStmt>) ,public void ifLabeledStmt(Consumer<com.github.javaparser.ast.stmt.LabeledStmt>) ,public void ifLocalClassDeclarationStmt(Consumer<com.github.javaparser.ast.stmt.LocalClassDeclarationStmt>) ,public void ifLocalRecordDeclarationStmt(Consumer<com.github.javaparser.ast.stmt.LocalRecordDeclarationStmt>) ,public void ifReturnStmt(Consumer<com.github.javaparser.ast.stmt.ReturnStmt>) ,public void ifSwitchStmt(Consumer<com.github.javaparser.ast.stmt.SwitchStmt>) ,public void ifSynchronizedStmt(Consumer<com.github.javaparser.ast.stmt.SynchronizedStmt>) ,public void ifThrowStmt(Consumer<com.github.javaparser.ast.stmt.ThrowStmt>) ,public void ifTryStmt(Consumer<com.github.javaparser.ast.stmt.TryStmt>) ,public void ifUnparsableStmt(Consumer<com.github.javaparser.ast.stmt.UnparsableStmt>) ,public void ifWhileStmt(Consumer<com.github.javaparser.ast.stmt.WhileStmt>) ,public void ifYieldStmt(Consumer<com.github.javaparser.ast.stmt.YieldStmt>) ,public boolean isAssertStmt() ,public boolean isBlockStmt() ,public boolean isBreakStmt() ,public boolean isContinueStmt() ,public boolean isDoStmt() ,public boolean isEmptyStmt() ,public boolean isExplicitConstructorInvocationStmt() ,public boolean isExpressionStmt() ,public boolean isForEachStmt() ,public boolean isForStmt() ,public boolean isIfStmt() ,public boolean isLabeledStmt() ,public boolean isLocalClassDeclarationStmt() ,public boolean isLocalRecordDeclarationStmt() ,public boolean isReturnStmt() ,public boolean isSwitchStmt() ,public boolean isSynchronizedStmt() ,public boolean isThrowStmt() ,public boolean isTryStmt() ,public boolean isUnparsableStmt() ,public boolean isWhileStmt() ,public boolean isYieldStmt() ,public Optional<com.github.javaparser.ast.stmt.AssertStmt> toAssertStmt() ,public Optional<com.github.javaparser.ast.stmt.BlockStmt> toBlockStmt() ,public Optional<com.github.javaparser.ast.stmt.BreakStmt> toBreakStmt() ,public Optional<com.github.javaparser.ast.stmt.ContinueStmt> toContinueStmt() ,public Optional<com.github.javaparser.ast.stmt.DoStmt> toDoStmt() ,public Optional<com.github.javaparser.ast.stmt.EmptyStmt> toEmptyStmt() ,public Optional<com.github.javaparser.ast.stmt.ExplicitConstructorInvocationStmt> toExplicitConstructorInvocationStmt() ,public Optional<com.github.javaparser.ast.stmt.ExpressionStmt> toExpressionStmt() ,public Optional<com.github.javaparser.ast.stmt.ForEachStmt> toForEachStmt() ,public Optional<com.github.javaparser.ast.stmt.ForStmt> toForStmt() ,public Optional<com.github.javaparser.ast.stmt.IfStmt> toIfStmt() ,public Optional<com.github.javaparser.ast.stmt.LabeledStmt> toLabeledStmt() ,public Optional<com.github.javaparser.ast.stmt.LocalClassDeclarationStmt> toLocalClassDeclarationStmt() ,public Optional<com.github.javaparser.ast.stmt.LocalRecordDeclarationStmt> toLocalRecordDeclarationStmt() ,public Optional<com.github.javaparser.ast.stmt.ReturnStmt> toReturnStmt() ,public Optional<com.github.javaparser.ast.stmt.SwitchStmt> toSwitchStmt() ,public Optional<com.github.javaparser.ast.stmt.SynchronizedStmt> toSynchronizedStmt() ,public Optional<com.github.javaparser.ast.stmt.ThrowStmt> toThrowStmt() ,public Optional<com.github.javaparser.ast.stmt.TryStmt> toTryStmt() ,public Optional<com.github.javaparser.ast.stmt.UnparsableStmt> toUnparsableStmt() ,public Optional<com.github.javaparser.ast.stmt.WhileStmt> toWhileStmt() ,public Optional<com.github.javaparser.ast.stmt.YieldStmt> toYieldStmt() <variables>