@Test
public void testMultipleEncrypts() throws Exception {

  // Checks whether multiple encryptions result in different ciphertexts.
  byte[] key = Random.randBytes(16);
  int ivSize = 16;
  AesCtrJceCipher cipher = new AesCtrJceCipher(key, ivSize);
  byte[] c1 = cipher.encrypt(msg);
  byte[] c2 = cipher.encrypt(msg);
  assertEquals(c1.length, c2.length);
  assertFalse(Arrays.equals(c1, c2));
}