public static void generateRefAccounts(Map<Short, Account> idToRefAccountMap,
      Map<Short, Map<Short, Container>> idToRefContainerMap, Set<Short> accountIdSet, int accountCount,
      int containerCountPerAccount) {
    idToRefAccountMap.clear();
    idToRefContainerMap.clear();
    for (int i = 0; i < accountCount; i++) {
      short accountId = Utils.getRandomShort(random);
      if (!accountIdSet.add(accountId)) {
        i--;
        continue;
      }
      String accountName = UUID.randomUUID().toString();
      Account.AccountStatus accountStatus =
          random.nextBoolean() ? Account.AccountStatus.ACTIVE : Account.AccountStatus.INACTIVE;
      List<Container> containers = new ArrayList<>();
      List<ContainerBuilder> containerBuilders = generateContainerBuilders(containerCountPerAccount, accountId);

      containers.addAll(containerBuilders.stream().map(ContainerBuilder::build).collect(Collectors.toList()));
      Map<Short, Container> idToContainers =
          containers.stream().collect(Collectors.toMap(Container::getId, Function.identity()));
      Account account = new AccountBuilder(accountId, accountName, accountStatus).containers(containers).build();
      assertEquals("Wrong number of generated containers for the account", containerCountPerAccount,
          account.getAllContainers().size());
      idToRefAccountMap.put(accountId, account);
      idToRefContainerMap.put(accountId, idToContainers);
    }
    assertEquals("Wrong number of generated accounts", accountCount, idToRefAccountMap.size());
  }
Randomly generates a collection of {@link Account}s, which do not have the same id or name. The {@link Container}s
of the same {@link Account} also do not have the same id or name.
@param idToRefAccountMap A map from id to {@link Account} to populate with the generated {@link Account}s.
@param idToRefContainerMap A map from name to {@link Account} to populate with the generated {@link Account}s.
@param accountIdSet A set of ids that could not be used to generate {@link Account}s.
@param accountCount The number of {@link Account}s to generate.
@param containerCountPerAccount The number of {@link Container}s per {@link Account} to generate.
ambry-test-utils/src/main/java/com/github/ambry/utils/AccountTestUtils.java