private void buildContainerWithBadFieldsAndFail(String name, ContainerStatus status, boolean encrypted,
      boolean previouslyEncrypted, Class<? extends Exception> exceptionClass) throws Exception {
    TestUtils.assertException(exceptionClass, () -> {
      new Container((short) 0, name, status, "description", encrypted, previouslyEncrypted, false, false, false, null, false,
          false, false, Collections.emptySet(), false, false, getRandomNamedBlobMode(), (short) 0, System.currentTimeMillis(),
          System.currentTimeMillis(), 0, null, null, null);
    }, null);
  }
Asserts that build a {@link Container} will fail because of missing field.
@param name The name for the {@link Container} to build.
@param status The status for the {@link Container} to build.
@param exceptionClass The class of expected exception.
ambry-api/src/test/java/com/github/ambry/account/AccountContainerTest.java