### Question:
SecretSession { public String decrypt(String encryptedSecret) { if (secretCache.containsKey(encryptedSecret)) { return secretCache.get(encryptedSecret); } else { String decryptedValue = secretManager.decrypt(encryptedSecret); addCachedSecret(encryptedSecret, decryptedValue); return decryptedValue; } } SecretSession(SecretManager secretManager); String decrypt(String encryptedSecret); Path decryptAsFile(String encryptedSecret); byte[] decryptAsBytes(String encrypted); void clearCachedSecrets(); void addCachedSecret(String encrypted, String decrypted); void addCachedSecretFile(String encrypted, Path decrypted);  }### Answer:
@Test public void decryptReturnsSecretFromCache() { String decrypted = secretSession.decrypt("encrypted:noop!f:test!k:key"); assertEquals("decrypted", decrypted); }
@Test public void decryptAddsToCacheOnCacheMiss() { assertEquals(1, secretSession.secretCache.size()); String decrypted = secretSession.decrypt("encrypted:noop!f:unknown!v:test"); assertEquals("test", decrypted); assertEquals("test", secretSession.secretCache.get("encrypted:noop!f:unknown!v:test")); assertEquals(2, secretSession.secretCache.size()); }