@Test
  public void testCreateFailsIfNotSupported() throws Exception {
    Assume.assumeFalse(ChaCha20Poly1305Jce.isSupported());

    ChaCha20Poly1305Key key = ChaCha20Poly1305Key.create(SecretBytes.randomBytes(32));
    assertThrows(GeneralSecurityException.class, () -> ChaCha20Poly1305Jce.create(key));
  }
This is a very simple test for the randomness of the nonce. The test simply checks that the
multiple ciphertexts of the same message are distinct.
java_src/src/test/java/com/google/crypto/tink/aead/internal/ChaCha20Poly1305JceTest.java