### Question:
AuthenticatorManager { Account getAccount(String accountId) { Logger.debug(TAG, "Retrieving Account with ID '%s' from the StorageClient.", accountId); Account account = storageClient.getAccount(accountId); initializeAccount(account); return account; } AuthenticatorManager(Context context, StorageClient storageClient, String deviceToken);   }### Answer:
@Test public void testShouldGetStoredAccountByID() { Account account = createAccount(ACCOUNT_NAME, ISSUER); Mechanism oath = createOathMechanism(ACCOUNT_NAME, ISSUER, OTHER_MECHANISM_UID); Mechanism push = createPushMechanism(ACCOUNT_NAME, ISSUER, MECHANISM_UID); List<Mechanism> mechanismList= new ArrayList<>(); mechanismList.add(push); mechanismList.add(oath); List<PushNotification> notificationList = new ArrayList<>(); notificationList.add(createPushNotification(MESSAGE_ID, push)); notificationList.add(createPushNotification(OTHER_MESSAGE_ID, push)); given(storageClient.getAccount(any(String.class))).willReturn(account); given(storageClient.getMechanismsForAccount(any(Account.class))).willReturn(mechanismList); given(storageClient.getAllNotificationsForMechanism(any(Mechanism.class))).willReturn(notificationList); Account accountFromStorage = authenticatorManager.getAccount(account.getId()); assertNotNull(accountFromStorage); assertEquals(account, accountFromStorage); assertEquals(2, accountFromStorage.getMechanisms().size()); }
@Test public void testShouldGetStoredAccountByMechanism() throws Exception { Account account = createAccount(ACCOUNT_NAME, ISSUER); Mechanism oath = createOathMechanism(ACCOUNT_NAME, ISSUER, OTHER_MECHANISM_UID); List<Mechanism> mechanismList= new ArrayList<>(); mechanismList.add(oath); given(storageClient.getAccount(any(String.class))).willReturn(account); given(storageClient.getMechanismByUUID(any(String.class))).willReturn(push); given(storageClient.getMechanismsForAccount(any(Account.class))).willReturn(mechanismList); Account accountFromStorage = authenticatorManager.getAccount(oath); assertNotNull(accountFromStorage); assertEquals(account, accountFromStorage); }