@Test
  public void testDuplicateContainerId() throws Exception {
    ArrayList<Container> containers = new ArrayList<>();
    // first container with (id=0, name="0")
    containers.add(buildContainerWithOtherFields(
        new ContainerBuilder((short) 0, "0", refContainerStatuses.get(0), refContainerDescriptions.get(0),
            refAccountId), refContainers.get(0)));
    // second container with (id=0, name="1")
    containers.add(buildContainerWithOtherFields(
        new ContainerBuilder((short) 0, "1", refContainerStatuses.get(0), refContainerDescriptions.get(0),
            refAccountId), refContainers.get(0)));
    createAccountWithBadContainersAndFail(containers, IllegalStateException.class);
  }
Tests constructing {@link Account} when supplying a list of {@link Container}s with duplicated id.
ambry-api/src/test/java/com/github/ambry/account/AccountContainerTest.java