public static bool IsSet(System.Type type) { return type.IsGenericType && typeof(ISet<>).MakeGenericType(type.GenericTypeArguments[0]).IsAssignableFrom(type); }