boolean (final Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; //noinspection unchecked ValueReference<K,V> that = (ValueReference<K, V>)o; V v = get(); V thatV = that.get(); return key.equals(that.getKey()) && v != null && v.equals(thatV); }