/// <summary>
        ///     Registers an open generic for the given dependency type if the dependency has not yet been registered; else
        ///     does nothing.
        /// </summary>
        /// <param name="registry">The `IComponentRegistry` instance to register the mapping against.</param>
        /// <param name="dependencyType">The open generic type of the dependency being registered.</param>
        /// <param name="implementationType">The open generic type of the implementation that should be resolved.</param>
        /// <param name="lifestyle">The lifestyle of the component.</param>
        public static IComponentRegistry AttemptRegisterGeneric(this IComponentRegistry registry, Type dependencyType,
                                                                Type implementationType, Lifestyle lifestyle)
        {
            Guard.AgainstNull(registry, nameof(registry));

            if (registry.IsRegistered(dependencyType))
            {
                return(registry);
            }

            registry.RegisterGeneric(dependencyType, implementationType, lifestyle);

            return(registry);
        }