public static ValidateTarget <TSet> IsProperSupersetOf <TSet, TItem>([ValidatedNotNull] this ValidateTarget <TSet> target, IEnumerable <TItem> valueToCompare, Func <string> getErrorMessage = null) where TSet : ISet <TItem> { if (target.Value != null) { if (!target.Value.IsProperSupersetOf(valueToCompare)) { ExceptionFactory.ThrowException(target.Traits.GenericFailureExceptionType, getErrorMessage != null ? getErrorMessage.Invoke() : ErrorMessageFactory.ShouldBeProperSupersetOf(target)); } } return(target); }