@Override
    public void run() {
      try {
        // Just an arbitrary prime to get the plaintext sizes.
        int p = 28657;
        for (int i = 0; i < count; i++) {
          // All sizes are used once when count > maxPlaintextSize.
          int size = i * p % (maxPlaintextSize + 1);
          int aadSize = (i / 2) * p % (maxPlaintextSize + 1);
          byte[] plaintext = new byte[size];
          byte[] aad = new byte[aadSize];
          byte[] ciphertext = cipher.encryptDeterministically(plaintext, aad);
          byte[] ciphertext2 = cipher.encryptDeterministically(plaintext, aad);
          TestUtil.assertByteArrayEquals("Encryption not deterministic", ciphertext, ciphertext2);
          byte[] decrypted = cipher.decryptDeterministically(ciphertext, aad);
          TestUtil.assertByteArrayEquals("Incorrect decryption", plaintext, decrypted);
        }
      } catch (Exception ex) {
        getUncaughtExceptionHandler().uncaughtException(this, ex);
      }
    }
Read the plaintext from the channel. This implementation assumes that the channel is blocking
and throws an AssertionError if an attempt to read plaintext from the channel is incomplete.
java_src/src/test/java/com/google/crypto/tink/subtle/DaeadThreadSafetyTest.java