Get an equal object from HashSet<T> in O(1)
There is no method on HashSet
that does what you want.
You can use a Dictionary
instead:
var dict = new Dictionary<MyClass, MyClass>();
dict[a] = a;
Debug.Assert(dict.ContainsKey(a_prime));
var retrieved_a = dict[a_prime];