### Question:
AnonymouslyEncryptedData { public static AnonymouslyEncryptedData encrypt(byte[] plaintext, byte[] secretBytes, byte[] theirPublicKey, byte[] nonce) { byte[] keySeed = Crypto.getKeySeed(secretBytes, theirPublicKey, nonce); byte[] myPrivateKey = Crypto.getPrivateKey(keySeed); byte[] myPublicKey = Crypto.getPublicKey(keySeed); byte[] sharedKey = Crypto.getSharedKey(myPrivateKey, theirPublicKey); byte[] data = Crypto.aesGCMEncrypt(plaintext, sharedKey); return new AnonymouslyEncryptedData(data, myPublicKey); } AnonymouslyEncryptedData(byte[] data, byte[] publicKey); static AnonymouslyEncryptedData encrypt(byte[] plaintext, byte[] secretBytes, byte[] theirPublicKey, byte[] nonce); static AnonymouslyEncryptedData readEncryptedData(ByteBuffer buffer, int length, int maxLength); static AnonymouslyEncryptedData readEncryptedData(byte[] bytes); byte[] decrypt(byte[] secretBytes); byte[] decrypt(byte[] keySeed, byte[] theirPublicKey); byte[] getData(); byte[] getPublicKey(); int getSize(); byte[] getBytes(); @Override String toString();  }### Answer:
@Test public void testEncrypt() throws IOException { byte[] plaintext = plain_data; byte[] theirPublicKey = Crypto.getPublicKey(secretPhraseB); AnonymouslyEncryptedData result_enc = AnonymouslyEncryptedData.encrypt(plaintext, secretPhraseA.getBytes(), theirPublicKey, nonce1); byte[] plain_res = result_enc.decrypt(secretPhraseB.getBytes()); assertArrayEquals(plaintext, plain_res); writeToFile(ByteBuffer.wrap(result_enc.getBytes()), TST_OUT_DIR+OUT_FILE_ENCRYPTED); }