// because Sets don't implement IEnumerable<> private static bool IsGenericCollection(Type type) => CollectionUtils.IsGenericType(type, typeof(IEnumerable <>)) || CollectionUtils.IsGenericType(type, typeof(ISet <>));