class ModifierVisitorGenerator extends VisitorGenerator {
    public ModifierVisitorGenerator(SourceRoot sourceRoot) {
        super(sourceRoot, "com.github.javaparser.ast.visitor", "ModifierVisitor", "Visitable", "A", true);
    }

    @Override
    protected void generateVisitMethodBody(BaseNodeMetaModel node, MethodDeclaration visitMethod, CompilationUnit compilationUnit) {
        visitMethod.getParameters().forEach(p -> p.setFinal(true));

        BlockStmt body = visitMethod.getBody().get();
        body.getStatements().clear();

        // FIXME: Bit of a hacky way to get this fixed order, and then have everything else (note this list is reversed)
        List<String> order = Arrays.asList(
//                "comment", "name", "members", "parameters", "name",
                "modifiers", "annotations"
        );
        List<PropertyMetaModel> sortedPropertyMetaModels = node.getAllPropertyMetaModels()
                .stream()
                .sorted(Comparator
                        .comparingInt((PropertyMetaModel o) -> order.indexOf(o.getName())).reversed()
//                        .thenComparing(PropertyMetaModel::getName)
                )
                .collect(Collectors.toList());

        //
        sortedPropertyMetaModels.forEach(property -> extracted(body, property));

        //
        if (node.is(BinaryExpr.class)) {
            body.addStatement("if (left == null) return right;");
            body.addStatement("if (right == null) return left;");
        } else {
            final SeparatedItemStringBuilder collapseCheck = new SeparatedItemStringBuilder("if(", "||", ") return null;");
            sortedPropertyMetaModels.forEach(property -> {
                if (property.isRequired() && property.isNode()) {
                    if (property.isNodeList()) {
                        if (property.isNonEmpty()) {
                            collapseCheck.append(f("%s.isEmpty()", property.getName()));
                        }
                    } else {
                        collapseCheck.append(f("%s==null", property.getName()));
                    }
                }
            });
            if (collapseCheck.hasItems()) {
                body.addStatement(collapseCheck.toString());
            }
        }

        //
        sortedPropertyMetaModels.forEach(property -> {
            if (property.isNode()) {
                body.addStatement(f("n.%s(%s);", property.getSetterMethodName(), property.getName()));
            }
        });

        //
        body.addStatement("return n;");
    }

    private void extracted(BlockStmt body, PropertyMetaModel property) {<FILL_FUNCTION_BODY>}
}

        if (property.isNode()) {
            if (property.isNodeList()) {
                body.addStatement(f("NodeList<%s> %s = modifyList(n.%s(), arg);",
                        property.getTypeNameGenerified(),
                        property.getName(),
                        property.getGetterMethodName()));
            } else if (property.isOptional()) {
                body.addStatement(f("%s %s = n.%s().map(s -> (%s) s.accept(this, arg)).orElse(null);",
                        property.getTypeNameGenerified(),
                        property.getName(),
                        property.getGetterMethodName(),
                        property.getTypeNameGenerified()));
            } else {
                body.addStatement(f("%s %s = (%s) n.%s().accept(this, arg);",
                        property.getTypeNameGenerified(),
                        property.getName(),
                        property.getTypeNameGenerified(),
                        property.getGetterMethodName()));
            }
        }
    
<methods>public final void generate() throws java.lang.Exception<variables>private final non-sealed java.lang.String argumentType,private final non-sealed boolean createMissingVisitMethods,private final non-sealed java.lang.String pkg,private final non-sealed java.lang.String returnType,private final non-sealed java.lang.String visitorClassName