Test serialization wen class has method bool ShouldSerialize<T>().
.NET throws an exception but it should have no effect on the serialization.
Ignore method ShouldSerialize if it is a generic.