}
@Test
public void testCipherSessionWriteKeyReuseCountOfTwo() throws Exception {
SaltedSecretKey masterKey = createDummyMasterKey();
CipherSession cipherSession = new CipherSession(masterKey, 999, 2);
CipherSpec cipherSpecAes128 = CipherSpecs.getCipherSpec(CipherSpecs.AES_128_GCM);
CipherSpec cipherSpecTwofish128 = CipherSpecs.getCipherSpec(CipherSpecs.TWOFISH_128_GCM);
SaltedSecretKey writeSecretKey1Aes128 = cipherSession.getWriteSecretKey(cipherSpecAes128);
SaltedSecretKey writeSecretKey2Aes128 = cipherSession.getWriteSecretKey(cipherSpecAes128);
SaltedSecretKey writeSecretKey3Aes128 = cipherSession.getWriteSecretKey(cipherSpecAes128);
SaltedSecretKey writeSecretKey1Twofish128 = cipherSession.getWriteSecretKey(cipherSpecTwofish128);
SaltedSecretKey writeSecretKey2Twofish128 = cipherSession.getWriteSecretKey(cipherSpecTwofish128);
SaltedSecretKey writeSecretKey3Twofish128 = cipherSession.getWriteSecretKey(cipherSpecTwofish128);
assertEquals(writeSecretKey1Aes128, writeSecretKey2Aes128);
assertNotSame(writeSecretKey1Aes128, writeSecretKey3Aes128);
assertEquals(writeSecretKey1Twofish128, writeSecretKey2Twofish128);