 <pre><code>using System.Collections.Generic; public class Test&lt;T&gt; { public T Value { get { return _Value; } set { if (!EqualityComparer&lt;T&gt;.Default.Equals(_Value, value)) { _Value = value; } } } private T _Value; } </code></pre>