/// <summary>
        /// Returns the fully qualified clone method name.
        /// </summary>
        public static string GenerateCloneMethodsForAssembly(
            CodeWriter writer,
            CompilerOptions options,
            Assembly assembly,
            TypeModelContainer container)
        {
            string @namespace = $"FlatSharp.Compiler.Generated";
            string className  = $"CloneHelpers_{Guid.NewGuid():n}";
            string methodName = "Clone";

            string fullyQualifiedMethodName = $"{@namespace}.{className}.{methodName}";

            HashSet <Type> seenTypes = new HashSet <Type>();

            foreach (var type in assembly.GetTypes())
            {
                if (type.IsNested)
                {
                    continue;
                }

                if (container.TryCreateTypeModel(type, out var typeModel))
                {
                    typeModel.TraverseObjectGraph(seenTypes);
                }
            }

            Dictionary <Type, string> methodNameMap = new Dictionary <Type, string>();

            foreach (var seenType in seenTypes)
            {
                methodNameMap[seenType] = fullyQualifiedMethodName;
            }

            writer.AppendLine($"namespace {@namespace}");
            using (writer.WithBlock())
            {
                writer.AppendLine($"internal static class {className}");
                using (writer.WithBlock())
                {
                    foreach (var seenType in seenTypes)
                    {
                        if (!container.TryCreateTypeModel(seenType, out ITypeModel? model))
                        {
                            ErrorContext.Current.RegisterError($"Unable to create type model for Type '{seenType.FullName}.'");
                            continue;
                        }

                        GenerateCloneMethod(writer, options, model, methodNameMap);
                    }
                }
            }

            return(fullyQualifiedMethodName);
        }