class AadUserListUpdater {

  public void updateAadUserList() throws AzureUserFetchException, AzureApiException {

    String accessToken = this.azureApiCaller.getAccessToken();

    Collection<AadUser> aadUserList = azureUserFetcher.fetchAzureUsers(accessToken);
    logger.info("Updating " + aadUserList.size() + " users...");
    for (AadUser aadUser : aadUserList) {
      aadUser.setMail(aadUser.getMail().toLowerCase());
      String photoAsBase64 = azurePhotoFetcher.getPhotoForUserId(accessToken, aadUser.getId());
      aadUser.setPhoto(photoAsBase64);
    }
    this.updateUserList(aadUserList);
  }

  @Autowired public  AadUserListUpdater(
      AzureUserFetcher azureUserFetcher,
      AadUserRepository aadUserRepository,
      AzurePhotoFetcher azurePhotoFetcher,
      AzureApiCaller azureApiCaller);

}