### Question:
ProtectedStorageEntry implements NetworkPayload, PersistablePayload { public boolean matchesRelevantPubKey(ProtectedStorageEntry protectedStorageEntry) { boolean result = protectedStorageEntry.getOwnerPubKey().equals(this.ownerPubKey); if (!result) { log.warn("New data entry does not match our stored data. storedData.ownerPubKey={}, ownerPubKey={}}", protectedStorageEntry.getOwnerPubKey().toString(), this.ownerPubKey); } return result; } ProtectedStorageEntry(@NotNull ProtectedStoragePayload protectedStoragePayload,
                                 @NotNull PublicKey ownerPubKey,
                                 int sequenceNumber,
                                 byte[] signature,
                                 Clock clock); protected  ProtectedStorageEntry(@NotNull ProtectedStoragePayload protectedStoragePayload,
                                    byte[] ownerPubKeyBytes,
                                    @NotNull PublicKey ownerPubKey,
                                    int sequenceNumber,
                                    byte[] signature,
                                    long creationTimeStamp,
                                    Clock clock); private  ProtectedStorageEntry(@NotNull ProtectedStoragePayload protectedStoragePayload,
                                  byte[] ownerPubKeyBytes,
                                  int sequenceNumber,
                                  byte[] signature,
                                  long creationTimeStamp,
                                  Clock clock); Message toProtoMessage(); protobuf.ProtectedStorageEntry toProtectedStorageEntry(); static ProtectedStorageEntry fromProto(protobuf.ProtectedStorageEntry proto,
                                                  NetworkProtoResolver resolver); void backDate(); boolean isExpired(Clock clock); boolean isValidForAddOperation(); boolean isValidForRemoveOperation(); boolean matchesRelevantPubKey(ProtectedStorageEntry protectedStorageEntry); @Override String toString();  }### Answer:
@Test public void isMetadataEquals() throws NoSuchAlgorithmException, CryptoException { KeyPair ownerKeys = TestUtils.generateKeyPair(); ProtectedStorageEntry seqNrOne = buildProtectedStorageEntry(ownerKeys, ownerKeys, 1); ProtectedStorageEntry seqNrTwo = buildProtectedStorageEntry(ownerKeys, ownerKeys, 2); Assert.assertTrue(seqNrOne.matchesRelevantPubKey(seqNrTwo)); }
@Test public void isMetadataEquals_OwnerPubKeyChanged() throws NoSuchAlgorithmException, CryptoException { KeyPair ownerKeys = TestUtils.generateKeyPair(); KeyPair notOwner = TestUtils.generateKeyPair(); ProtectedStorageEntry protectedStorageEntryOne = buildProtectedStorageEntry(ownerKeys, ownerKeys, 1); ProtectedStorageEntry protectedStorageEntryTwo = buildProtectedStorageEntry(ownerKeys, notOwner, 1); Assert.assertFalse(protectedStorageEntryOne.matchesRelevantPubKey(protectedStorageEntryTwo)); }