boolean (Object obj) { V v = get(); if (!(obj instanceof MyRef)) { return false; } //noinspection unchecked MyRef<V> other = (MyRef<V>)obj; return other.hash == hash && key == other.getKey() && Comparing.equal(v, other.get()); }