### Question:
DecrypterManager { public synchronized void decryptSaved(CapillaryHandler handler, Object extra) { List<byte[]> ciphertexts = ciphertextStorage.get(); ciphertextStorage.clear(); for (byte[] data : ciphertexts) { decrypt(data, handler, extra); } } DecrypterManager(
      Context context, KeyManager keyManager, CiphertextStorage ciphertextStorage, Utils utils); synchronized void decryptSaved(CapillaryHandler handler, Object extra); synchronized void decrypt(byte[] ciphertext, CapillaryHandler handler, Object extra);  }### Answer:
@Test public void testSavedDecryption() { decrypterManager.decryptSaved(handler, extra); verifyZeroInteractions(handler); int ciphertextCount = 10; ciphertextBuilder.setIsAuthKey(true); byte[] ciphertextBytes = ciphertextBuilder.build().toByteArray(); saveCiphertexts(ciphertextBytes, ciphertextCount, ciphertextStorage); decrypterManager.decryptSaved(handler, extra); verify(handler, times(ciphertextCount)).handleData(true, PLAINTEXT.getBytes(), extra); verifyNoMoreInteractions(handler); }
@Test public void testSavedDecryptionWithScreenLock() { when(utils.isScreenLocked(context)).thenReturn(true); decrypterManager.decryptSaved(handler, extra); verifyZeroInteractions(handler); int ciphertextCount = 10; ciphertextBuilder.setIsAuthKey(true); byte[] ciphertextBytes = ciphertextBuilder.build().toByteArray(); saveCiphertexts(ciphertextBytes, ciphertextCount, ciphertextStorage); decrypterManager.decryptSaved(handler, extra); verify(handler, times(ciphertextCount)).authCiphertextSavedForLater(ciphertextBytes, extra); verifyNoMoreInteractions(handler); }