public IComponentFeatureCollection With(IComponentFeature feature)
        {
            if (feature == null)
            {
                throw new ArgumentNullException(nameof(feature));
            }

            if (!_features.Add(feature))
            {
                throw new InvalidOperationException();
            }

            return(this);
        }
        public bool Has(IComponentFeature state)
        {
            if (state == null)
            {
                throw new ArgumentNullException(nameof(state));
            }

            var foundState = _features.FirstOrDefault(s => s.GetType() == state.GetType());

            if (foundState == null)
            {
                throw new ComponentFeatureNotSupportedException(state.GetType());
            }

            return(ReferenceEquals(state, foundState) || foundState.Equals(state));
        }