class TemplateEndModelProcessable implements IEngineProcessable {

    private final ITemplateEnd templateEnd;
    private final Model model;
    private final ITemplateHandler modelHandler;
    private final ProcessorTemplateHandler processorTemplateHandler;
    private final ITemplateHandler nextHandler;
    private final TemplateFlowController flowController;

    private int offset;


    TemplateEndModelProcessable(
            final ITemplateEnd templateEnd,
            final Model model, final ITemplateHandler modelHandler,
            final ProcessorTemplateHandler processorTemplateHandler, final ITemplateHandler nextHandler,
            final TemplateFlowController flowController) {
        super();
        this.templateEnd = templateEnd;
        this.model = model;
        this.modelHandler = modelHandler;
        this.processorTemplateHandler = processorTemplateHandler;
        this.nextHandler = nextHandler;
        this.flowController = flowController;
        this.offset = 0;
    }


    public boolean process() {<FILL_FUNCTION_BODY>}


}


        /*
         * First, check the stopProcess flag
         */
        if (this.flowController.stopProcessing) {
            return false;
        }

        /*
         * Process the queue
         */
        this.offset += this.model.process(this.modelHandler, this.offset, this.flowController);
        if (this.offset < this.model.queueSize || this.flowController.stopProcessing) {
            return false;
        }


        /*
         * PROCESS THE REST OF THE HANDLER CHAIN.
         */
        this.nextHandler.handleTemplateEnd(this.templateEnd);


        /*
         * LAST ROUND OF CHECKS. If we have not returned our indexes to -1, something has gone wrong during processing
         */
        this.processorTemplateHandler.performTearDownChecks(this.templateEnd);


        /*
         * RETURN TRUE. Even if a stop was signaled after handling the TemplateEnd, we should not worry about it
         * because it would only affect events being executed AFTER delegating. And there are no events executing
         * after the TemplateEnd, ever.
         */
        return true;

    
<no_super_class>