Or...

```csharp
public static void IsReadOnlyCollection<T>(object instance) where T : class
{
    var collection = instance as ICollection<T>;
    Assert.True(collection == null || collection.IsReadOnly);
}
```