class ThymeleafPlugin {
    private static final AgentLogger LOGGER = AgentLogger.getLogger(ThymeleafPlugin.class);

    @OnClassLoadEvent(classNameRegexp = "org.thymeleaf.engine.TemplateManager")
    public static void patchParseAndProcess(ClassPool classPool, final CtClass ctClass) {<FILL_FUNCTION_BODY>}
}

        try {
            CtMethod method = ctClass.getDeclaredMethod("parseAndProcess", new CtClass[]{
                    classPool.get("org.thymeleaf.TemplateSpec"), classPool.get("org.thymeleaf.context.IContext"),
                    classPool.get("java.io.Writer")});
            method.insertBefore("clearCachesFor($1.getTemplate());");
        } catch (NotFoundException | CannotCompileException e) {
            LOGGER.debug("Cannot patch parseAndProcess method for {}", ctClass.getName(), e);
        }
    
<no_super_class>