// Allow overriding this in tests
        public virtual UnityEngine.Object DeclareDependencyAndLoad(string path, string subAssetPath)
        {
            if (path.StartsWith(kThemePrefix))
            {
                var themeName = path.Substring(kThemePrefix.Length);


                if (!ThemeRegistry.themes.TryGetValue(themeName, out var themePath))
                {
                    return(null);
                }

                var themeAssetToCopy = EditorGUIUtility.Load(themePath);
                Debug.Assert(themeAssetToCopy != null, $"Theme not found searching for '{themeName}' at <{themePath}>.");

                if (themeAssetToCopy != null)
                {
                    var clonedAssets = DeepCopyAsset(themeAssetToCopy);

                    if (clonedAssets.Count > 0)
                    {
                        clonedAssets[0].name = themeName;
                        int assetIndex = 0;
                        foreach (var clonedAsset in clonedAssets)
                        {
                            m_Context.AddObjectToAsset($"asset {assetIndex++}: clonedAsset.name", clonedAsset);
                        }

                        return(clonedAssets[0]);
                    }
                }
                return(null);
            }

            m_Context?.DependsOnSourceAsset(path);

            if (string.IsNullOrEmpty(subAssetPath))
            {
                return(AssetDatabase.LoadMainAssetAtPath(path));
            }

            var mainAsset = AssetDatabase.LoadMainAssetAtPath(path);

            foreach (var o in AssetDatabase.LoadAllAssetsAtPath(path))
            {
                if (o == mainAsset)
                {
                    continue; // We're looking for a sub-asset here
                }
                if (o.name == subAssetPath)
                {
                    return(o);
                }
            }
            return(null);
        }
        // Allow overriding this in tests
        public virtual UnityEngine.Object DeclareDependencyAndLoad(string path, string subAssetPath)
        {
            m_Context?.DependsOnSourceAsset(path);

            if (string.IsNullOrEmpty(subAssetPath))
            {
                return(AssetDatabase.LoadMainAssetAtPath(path));
            }

            var mainAsset = AssetDatabase.LoadMainAssetAtPath(path);

            foreach (var o in AssetDatabase.LoadAllAssetsAtPath(path))
            {
                if (o == mainAsset)
                {
                    continue; // We're looking for a sub-asset here
                }
                if (o.name == subAssetPath)
                {
                    return(o);
                }
            }

            return(null);
        }