class Spring5VersionSpecificUtility implements ISpringVersionSpecificUtility {




    Spring5VersionSpecificUtility() {
        super();
    }



    public EvaluationContext wrapEvaluationContext(
            final EvaluationContext evaluationContext, final IExpressionObjects expresionObjects) {
        final IThymeleafEvaluationContext thymeleafEvaluationContext = new ThymeleafEvaluationContextWrapper(evaluationContext);
        thymeleafEvaluationContext.setExpressionObjects(expresionObjects);
        return thymeleafEvaluationContext;
    }




    @Override
    public boolean isWebContext(final IContext context) {
        if (context instanceof IWebContext) {
            return true;
        }
        return false;
    }



    @Override
    public boolean isWebMvcContext(final IContext context) {
        if (context instanceof IWebContext) {
            IWebContext webContext = (IWebContext) context;
            IWebExchange webExchange = webContext.getExchange();
            if (webExchange instanceof IServletWebExchange) {
                return true;
            }
        }
        return false;
    }



    @Override
    public boolean isWebFluxContext(final IContext context) {
        if (!isWebContext(context)) {
            return false;
        }
        return getWebExchange(context) instanceof ISpringWebFluxWebExchange;
    }




    @Override
    public HttpServletRequest getHttpServletRequest(final IContext context) {
        return (HttpServletRequest) getServletWebExchange(context).getNativeRequestObject();
    }




    @Override
    public HttpServletResponse getHttpServletResponse(final IContext context) {
        return (HttpServletResponse) getServletWebExchange(context).getNativeResponseObject();
    }




    @Override
    public ServerWebExchange getServerWebExchange(final IContext context) {
        IWebExchange webExchange = getWebExchange(context);
        if (webExchange instanceof ISpringWebFluxWebExchange) {
            ISpringWebFluxWebExchange webFluxWebExchange = (ISpringWebFluxWebExchange) webExchange;
            return (ServerWebExchange) webFluxWebExchange.getNativeExchangeObject();
        }
        throw new TemplateProcessingException(
                "Cannot obtain ServerWebExchange from a non-WebFlux context implementation (\"" +
                context.getClass().getName() + "\")");
    }




    private static IServletWebExchange getServletWebExchange(final IContext context) {<FILL_FUNCTION_BODY>}



    private static IWebExchange getWebExchange(final IContext context) {
        if (context instanceof IWebContext) {
            IWebContext webContext = (IWebContext) context;
            return webContext.getExchange();
        }
        throw new TemplateProcessingException(
                "Cannot obtain IWebExchange from a non-Servlet context implementation (\"" +
                context.getClass().getName() + "\")");
    }


}

        IWebExchange webExchange = getWebExchange(context);
        if (webExchange instanceof IServletWebExchange) {
            return (IServletWebExchange) webExchange;
        }
        throw new TemplateProcessingException(
                "Cannot obtain IServletWebExchange from a non-Servlet context implementation (\"" +
                context.getClass().getName() + "\")");
    
<no_super_class>