@Override
  public synchronized void updateAccounts(Collection<Account> accounts) throws AccountServiceException {
    if (!shouldUpdateSucceed) {
      throw new AccountServiceException("Update failed", AccountServiceErrorCode.InternalError);
    }
    for (Account account : accounts) {
      idToAccountMap.put(account.getId(), account);
      nameToAccountMap.put(account.getName(), account);
    }
    if (notifyConsumers) {
      for (Consumer<Collection<Account>> accountUpdateConsumer : accountUpdateConsumers) {
        accountUpdateConsumer.accept(accounts);
      }
    }
  }
Constructor.
@param shouldReturnOnlyUnknown {@code true} if always returns {@link InMemAccountService#UNKNOWN_ACCOUNT} when queried
                                                    by account name; {@code false} to do the actual query.
@param notifyConsumers {@code true} if consumers should be notified of account changes. {@code false} otherwise.
ambry-test-utils/src/main/java/com/github/ambry/account/InMemAccountService.java