### Question:
RecoverableKeyStoreSecondaryKeyManager { public Optional<RecoverableKeyStoreSecondaryKey> get(String alias) throws InternalRecoveryServiceException, UnrecoverableKeyException { SecretKey secretKey = (SecretKey) mRecoveryController.getKey(alias); return Optional.ofNullable(secretKey) .map(key -> new RecoverableKeyStoreSecondaryKey(alias, key)); } @VisibleForTesting  RecoverableKeyStoreSecondaryKeyManager(
            RecoveryController recoveryController, SecureRandom secureRandom); static RecoverableKeyStoreSecondaryKeyManager getInstance(Context context); RecoverableKeyStoreSecondaryKey generate(); void remove(String alias); Optional<RecoverableKeyStoreSecondaryKey> get(String alias);  }### Answer:
@Test public void get_forNonExistentKey_returnsEmptyOptional() throws Exception { Optional<RecoverableKeyStoreSecondaryKey> retrievedKey = mRecoverableKeyStoreSecondaryKeyManager.get(NONEXISTENT_KEY_ALIAS); assertThat(retrievedKey.isPresent()).isFalse(); }
@Test public void get_encounteringInternalException_doesNotPropagateException() throws Exception { ShadowRecoveryController.setThrowsInternalError(true); mRecoverableKeyStoreSecondaryKeyManager.get(NONEXISTENT_KEY_ALIAS); }