private void assertContainer(Container container, int index) {
    assertEquals("Wrong container ID", (short) refContainerIds.get(index), container.getId());
    assertEquals("Wrong name", refContainerNames.get(index), container.getName());
    assertEquals("Wrong status", refContainerStatuses.get(index), container.getStatus());
    assertEquals("Wrong description", refContainerDescriptions.get(index), container.getDescription());
    assertEquals("Wrong caching setting", refContainerCachingValues.get(index), container.isCacheable());
    assertEquals("Wrong account ID", refAccountId, container.getParentAccountId());
    switch (Container.getCurrentJsonVersion()) {
      case Container.JSON_VERSION_1:
        assertEquals("Wrong encryption setting", ENCRYPTED_DEFAULT_VALUE, container.isEncrypted());
        assertEquals("Wrong previous encryption setting", PREVIOUSLY_ENCRYPTED_DEFAULT_VALUE,
            container.wasPreviouslyEncrypted());
        assertEquals("Wrong media scan disabled setting", MEDIA_SCAN_DISABLED_DEFAULT_VALUE,
            container.isMediaScanDisabled());
        assertEquals("Wrong paranoid durability enabled setting", PARANOID_DURABILITY_ENABLED_DEFAULT_VALUE,
            container.isParanoidDurabilityEnabled());
        assertNull("Wrong replication policy", container.getReplicationPolicy());
        assertEquals("Wrong ttl required setting", TTL_REQUIRED_DEFAULT_VALUE, container.isTtlRequired());
        assertEquals("Wrong workflow migration enabled setting", WORKFLOW_MIGRATION_ENABLED_DEFAULT_VALUE, container.isWorkflowMigrationEnabled());
        assertEquals("Wrong secure path required setting", SECURE_PATH_REQUIRED_DEFAULT_VALUE,
            container.isSecurePathRequired());
        assertEquals("Wrong override account acl setting", OVERRIDE_ACCOUNT_ACL_DEFAULT_VALUE,
            container.isAccountAclOverridden());
        assertEquals("Wrong accessControlAllowOrigin", "", container.getAccessControlAllowOrigin());
        break;
      case Container.JSON_VERSION_2:
        assertEquals("Wrong encryption setting", refContainerEncryptionValues.get(index), container.isEncrypted());
        assertEquals("Wrong previous encryption setting", refContainerPreviousEncryptionValues.get(index),
            container.wasPreviouslyEncrypted());
        assertEquals("Wrong media scan disabled setting", refContainerMediaScanDisabledValues.get(index),
            container.isMediaScanDisabled());
        assertEquals("Wrong paranoid durability enabled setting", refContainerParanoidDurabilityEnabledValues.get(index),
            container.isParanoidDurabilityEnabled());
        assertEquals("Wrong replication policy", refContainerReplicationPolicyValues.get(index),
            container.getReplicationPolicy());
        assertEquals("Wrong ttl required setting", refContainerTtlRequiredValues.get(index), container.isTtlRequired());
        assertEquals("Wrong workflow migration enabled setting", refContainerWorkflowMigrationEnabledValues.get(index), container.isWorkflowMigrationEnabled());
        assertEquals("Wrong secure path required setting", refContainerSignedPathRequiredValues.get(index),
            container.isSecurePathRequired());
        assertEquals("Wrong override account acl setting", refContainerOverrideAccountAcls.get(index),
            container.isAccountAclOverridden());
        assertEquals("Wrong named blob mode setting", refContainerNamedBlobModes.get(index),
            container.getNamedBlobMode());
        Set<String> expectedContentTypeAllowListForFilenamesOnDownloadValue =
            refContainerContentTypeAllowListForFilenamesOnDownloadValues.get(index) == null ? Collections.emptySet()
                : refContainerContentTypeAllowListForFilenamesOnDownloadValues.get(index);
        assertEquals("Wrong content types allow listed for filename on download",
            expectedContentTypeAllowListForFilenamesOnDownloadValue,
            container.getContentTypeWhitelistForFilenamesOnDownload());
        assertEquals("Wrong last modified time setting", (long) refContainerLastModifiedTimes.get(index),
            container.getLastModifiedTime());
        assertEquals("Wrong snapshot version setting", (int) refContainerSnapshotVersions.get(index),
            container.getSnapshotVersion());
        assertEquals("Wrong accessControlAllowOrigin", refAccessControlAllowOriginValues.get(index),
            container.getAccessControlAllowOrigin());
        assertEquals("Wrong cacheTtlInSeconds", refContainerCacheTtlInSeconds.get(index),
            container.getCacheTtlInSecond());
        Set<String> expectedUserMetadataKeysToNotPrefixInResponse =
            refContainerUserMetadataKeysToNotPrefixInResponses.get(index) == null ? Collections.emptySet()
                : refContainerUserMetadataKeysToNotPrefixInResponses.get(index);
        assertEquals("Wrong user metadata keys to not prefix in response",
            expectedUserMetadataKeysToNotPrefixInResponse, container.getUserMetadataKeysToNotPrefixInResponse());
        break;
      default:
        throw new IllegalStateException("Unsupported version: " + Container.getCurrentJsonVersion());
    }
  }
Asserts a {@link Container} against the reference account for every internal field
@param container The {@link Container} to assert.
@param index The index in the reference container list to assert against.
ambry-api/src/test/java/com/github/ambry/account/AccountContainerTest.java