/* A WeakKey is equal to another WeakKey iff they both refer to objects
    that are, in turn, equal according to their own equals methods */
@Pure
    @Override
    public boolean equals(@Nullable Object o) {
      if (o == null) return false; // never happens
      if (this == o) return true;
      // This test is illegal because WeakKey is a generic type,
      // so use the getClass hack below instead.
      // if (!(o instanceof WeakKey)) return false;
      if (!(o.getClass().equals(WeakKey.class))) return false;
      Object t = this.get();
      @SuppressWarnings("unchecked")
      Object u = ((WeakKey) o).get();
      if ((t == null) || (u == null)) return false;
      if (t == u) return true;
      return keyEquals(t, u);
    }
@Pure
@Override
public boolean equals(@Nullable Object o) {
if (o == null) return false; // never happens
if (this == o) return true;
// This test is illegal because WeakKey is a generic type,
// so use the getClass hack below instead.
// if (!(o instanceof WeakKey)) return false;
if (!(o.getClass().equals(WeakKey.class))) return false;
Object t = this.get();
@SuppressWarnings("unchecked")
Object u = ((WeakKey) o).get();
if ((t == null) || (u == null)) return false;
if (t == u) return true;
return keyEquals(t, u);
}
@Pure
@Override
public boolean equals(@Nullable Object o) {
if (o == null) return false; // never happens
if (this == o) return true;
// This test is illegal because WeakKey is a generic type,
// so use the getClass hack below instead.
// if (!(o instanceof WeakKey)) return false;
if (!(o.getClass().equals(WeakKey.class))) return false;
Object t = this.get();
@SuppressWarnings("unchecked")
Object u = ((WeakKey) o).get();
if ((t == null) || (u == null)) return false;
if (t == u) return true;
return keyEquals(t, u);
}
@Pure
@Override
public boolean equals(@Nullable Object o) {
if (o == null) return false; // never happens
if (this == o) return true;
// This test is illegal because WeakKey is a generic type,
// so use the getClass hack below instead.
// if (!(o instanceof WeakKey)) return false;
if (!(o.getClass().equals(WeakKey.class))) return false;
Object t = this.get();
@SuppressWarnings("unchecked")
Object u = ((WeakKey) o).get();
if ((t == null) || (u == null)) return false;
if (t == u) return true;
return keyEquals(t, u);
}