/// <summary>
        /// Initializes a new instance of the <see cref="UserRegistry"/> class.
        /// </summary>
        /// <param name="users">The users.</param>
// ReSharper disable ParameterTypeCanBeEnumerable.Local
        public UserRegistry(User[] users)
// ReSharper restore ParameterTypeCanBeEnumerable.Local
        {
            if (users == null)
            {
                return;
            }

            foreach (User user in users)
            {
                Add(user);
            }
        }
        /// <summary>
        /// Adds the specified user.
        /// </summary>
        /// <param name="user">The user.</param>
        public void Add(User user)
        {
            if (user == null)
            {
                return;
            }
            
            if (_users.ContainsKey(user.Name))
            {
                _users.Remove(user.Name);
            }

            _users.Add(user.Name, user);
        }
        /// <summary>
        /// Adds the specified user.
        /// </summary>
        /// <param name="user">The user.</param>
        public UserRegistry Add(User user)
        {
            if (user == null)
            {
                return this;
            }
            
            if (_users.ContainsKey(user.Name))
            {
                _users.Remove(user.Name);
            }

            _users.Add(user.Name, user);
            return this;
        }