protected function addBuildMethodsAndAdvicesCodeToClass(string $className, ClassNameIndex $treatedSubClasses): ClassNameIndex
    {
        if ($treatedSubClasses->hasClassName($className)) {
            return $treatedSubClasses;
        }

        $treatedSubClasses = $treatedSubClasses->union(new ClassNameIndex([$className]));
        if ($this->reflectionService->isClassReflected($className) === false) {
            return $treatedSubClasses;
        }

        $proxyClass = $this->compiler->getProxyClass($className);
        if ($proxyClass === false) {
            return $treatedSubClasses;
        }

        $callBuildMethodsAndAdvicesArrayCode = "        if (method_exists(get_parent_class(), 'Flow_Aop_Proxy_buildMethodsAndAdvicesArray') && is_callable('parent::Flow_Aop_Proxy_buildMethodsAndAdvicesArray')) parent::Flow_Aop_Proxy_buildMethodsAndAdvicesArray();\n";
        $proxyClass->getConstructor()->addPreParentCallCode($callBuildMethodsAndAdvicesArrayCode);
        $proxyClass->getMethod('__wakeup')->addPreParentCallCode($callBuildMethodsAndAdvicesArrayCode);

        return $treatedSubClasses;
    }