### Question:
EncryptedRawTransaction implements Serializable { @Override public boolean equals(final Object obj) { return (obj instanceof EncryptedRawTransaction) && Objects.equals(this.hash, ((EncryptedRawTransaction) obj).hash); } EncryptedRawTransaction(
            final MessageHash hash,
            final byte[] encryptedPayload,
            final byte[] encryptedKey,
            final byte[] nonce,
            final byte[] sender);  EncryptedRawTransaction(); @PrePersist void onPersist(); MessageHash getHash(); void setHash(final MessageHash hash); byte[] getEncryptedPayload(); void setEncryptedPayload(byte[] encryptedPayload); byte[] getEncryptedKey(); void setEncryptedKey(byte[] encryptedKey); byte[] getNonce(); void setNonce(byte[] nonce); long getTimestamp(); byte[] getSender(); void setSender(byte[] sender); @Override int hashCode(); @Override boolean equals(final Object obj); RawTransaction toRawTransaction();  }### Answer:
@Test public void subclassesEqual() { class OtherClass extends EncryptedRawTransaction {} final OtherClass other = new OtherClass(); final EncryptedRawTransaction et = new EncryptedRawTransaction(); final boolean equal = Objects.equals(et, other); assertThat(equal).isTrue(); }
@Test public void differentClassesNotEqual() { final Object other = "OTHER"; final EncryptedRawTransaction et = new EncryptedRawTransaction(); final boolean equal = Objects.equals(et, other); assertThat(equal).isFalse(); }