private void assertAccountAgainstReference(Account account, boolean compareContainer) {
    assertEquals(refAccountId, account.getId());
    assertEquals(refAccountName, account.getName());
    assertEquals(refAccountStatus, account.getStatus());
    assertEquals("Snapshot versions do not match", refAccountSnapshotVersion, account.getSnapshotVersion());
    assertEquals("Acl inherited by container settings don't match", refAccountAclInheritedByContainer,
        account.isAclInheritedByContainer());
    if (compareContainer) {
      Collection<Container> containersFromAccount = account.getAllContainers();
      assertEquals("Wrong number of containers.", CONTAINER_COUNT, containersFromAccount.size());
      assertEquals(CONTAINER_COUNT, containersFromAccount.size());
      for (int i = 0; i < CONTAINER_COUNT; i++) {
        assertContainer(account.getContainerById(refContainerIds.get(i)), i);
        assertContainer(account.getContainerByName(refContainerNames.get(i)), i);
      }
    }
  }
Asserts an {@link Account} against the reference account.
@param account The {@link Account} to assert.
@param compareContainer {@code true} to compare each individual {@link Container}. {@code false} to skip this test.
ambry-api/src/test/java/com/github/ambry/account/AccountContainerTest.java