### Question:
EncryptedRawTransaction implements Serializable { public RawTransaction toRawTransaction() { return new RawTransaction( this.encryptedPayload, this.encryptedKey, new Nonce(this.nonce), PublicKey.from(this.sender)); } 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 toRawTransaction() { byte[] payload = "PAYLOAD".getBytes(); MessageHash hash = mock(MessageHash.class); byte[] key = "key".getBytes(); byte[] nonce = "nonce".getBytes(); byte[] from = "from".getBytes(); EncryptedRawTransaction encryptedRawTransaction = new EncryptedRawTransaction(hash, payload, key, nonce, from); RawTransaction rawTransaction = encryptedRawTransaction.toRawTransaction(); assertThat(rawTransaction).isNotNull(); assertThat(rawTransaction.getEncryptedPayload()).isEqualTo(payload); assertThat(rawTransaction.getEncryptedKey()).isEqualTo(key); assertThat(rawTransaction.getNonce().getNonceBytes()).isEqualTo(nonce); assertThat(rawTransaction.getFrom().getKeyBytes()).isEqualTo(from); }