public boolean equals(final Object o) { if (o == this) { return true; } if (!(o instanceof BSONObject)) { return false; } final BSONObject other = (BSONObject) o; return ((HashMap<String, V>) this).keySet().equals(other.keySet()) && Arrays.equals( canonicalizeBSONObject(this).encode(), canonicalizeBSONObject(other).encode()); }
public int hashCode() { return Arrays.hashCode(canonicalizeBSONObject(this).encode()); }