private void checkDuplicateContainerNameOrId(Container container) {
    if (containerIdToContainerMap.containsKey(container.getId()) || containerNameToContainerMap.containsKey(
        container.getName())) {
      Container conflictContainer = containerIdToContainerMap.get(container.getId());
      conflictContainer =
          conflictContainer == null ? containerNameToContainerMap.get(container.getName()) : conflictContainer;
      String errorMessage =
          new StringBuilder("Duplicate container id or name exists. containerId=").append(container.getId())
              .append(" containerName=")
              .append(container.getName())
              .append(" conflicts with containerId=")
              .append(conflictContainer.getId())
              .append(" containerName=")
              .append(conflictContainer.getName())
              .toString();
      throw new IllegalStateException(errorMessage);
    }
  }
Checks a {@link Container}'s id or name conflicts with those in {@link #containerIdToContainerMap} or
{@link #containerNameToContainerMap}.
@param container A {@code Container} to check conflicting name or id.
@throws IllegalStateException If there are containers that have different ids but the same names, or vise versa.
ambry-api/src/main/java/com/github/ambry/account/Account.java