@Test public void contacts_with_different_identity_key_contents_are_not_equal() { byte[] profileKey = new byte[32]; byte[] profileKeyCopy = profileKey.clone(); profileKeyCopy[0] = 1; SignalContactRecord a = contactBuilder(1, UUID_A, E164_A, "a").setIdentityKey(profileKey).build(); SignalContactRecord b = contactBuilder(1, UUID_A, E164_A, "a").setIdentityKey(profileKeyCopy).build(); assertNotEquals(a, b); assertNotEquals(a.hashCode(), b.hashCode()); }
@Override public int hashCode() { return Objects.hash(id, proto); }
SignalContactRecord implements SignalRecord { @Override public int hashCode() { return Objects.hash(id, proto); } }
SignalContactRecord implements SignalRecord { @Override public int hashCode() { return Objects.hash(id, proto); } SignalContactRecord(StorageId id, ContactRecord proto); }
SignalContactRecord implements SignalRecord { @Override public int hashCode() { return Objects.hash(id, proto); } SignalContactRecord(StorageId id, ContactRecord proto); @Override StorageId getId(); boolean hasUnknownFields(); byte[] serializeUnknownFields(); SignalServiceAddress getAddress(); Optional<String> getGivenName(); Optional<String> getFamilyName(); Optional<byte[]> getProfileKey(); Optional<String> getUsername(); Optional<byte[]> getIdentityKey(); IdentityState getIdentityState(); boolean isBlocked(); boolean isProfileSharingEnabled(); boolean isArchived(); boolean isForcedUnread(); @Override boolean equals(Object o); @Override int hashCode(); }
SignalContactRecord implements SignalRecord { @Override public int hashCode() { return Objects.hash(id, proto); } SignalContactRecord(StorageId id, ContactRecord proto); @Override StorageId getId(); boolean hasUnknownFields(); byte[] serializeUnknownFields(); SignalServiceAddress getAddress(); Optional<String> getGivenName(); Optional<String> getFamilyName(); Optional<byte[]> getProfileKey(); Optional<String> getUsername(); Optional<byte[]> getIdentityKey(); IdentityState getIdentityState(); boolean isBlocked(); boolean isProfileSharingEnabled(); boolean isArchived(); boolean isForcedUnread(); @Override boolean equals(Object o); @Override int hashCode();  }