using System.Collections.Generic;
public class Test: IEquatable<Test>
public int SomeMutableValue;
public bool Equals(Test other)
return other.SomeMutableValue == SomeMutableValue;
public static void Main()
var dict = new Dictionary<Test, string>();
var t1 = new Test(){SomeMutableValue = 1};
Console.WriteLine(t1.GetHashCode());
var t2 = new Test(){SomeMutableValue = 2};
Console.WriteLine(t2.GetHashCode());
var lookForMe = new Test(){SomeMutableValue = 2};
Console.WriteLine(lookForMe.GetHashCode());
Console.WriteLine(dict.ContainsKey(lookForMe));