public void container(Action<? super ContainerParameters> action) {
    action.execute(container);
  }
@Test
  public void testContainer() {
    assertThat(testJibExtension.getContainer().getJvmFlags()).isEmpty();
    assertThat(testJibExtension.getContainer().getEnvironment()).isEmpty();
    assertThat(testJibExtension.getContainer().getExtraClasspath()).isEmpty();
    assertThat(testJibExtension.getContainer().getExpandClasspathDependencies()).isFalse();
    assertThat(testJibExtension.getContainer().getMainClass()).isNull();
    assertThat(testJibExtension.getContainer().getArgs()).isNull();
    assertThat(testJibExtension.getContainer().getFormat()).isSameInstanceAs(ImageFormat.Docker);
    assertThat(testJibExtension.getContainer().getPorts()).isEmpty();
    assertThat(testJibExtension.getContainer().getLabels().get()).isEmpty();
    assertThat(testJibExtension.getContainer().getAppRoot()).isEmpty();
    assertThat(testJibExtension.getContainer().getFilesModificationTime().get())
        .isEqualTo("EPOCH_PLUS_SECOND");
    assertThat(testJibExtension.getContainer().getCreationTime().get()).isEqualTo("EPOCH");

    testJibExtension.container(
        container -> {
          container.setJvmFlags(Arrays.asList("jvmFlag1", "jvmFlag2"));
          container.setEnvironment(ImmutableMap.of("var1", "value1", "var2", "value2"));
          container.setEntrypoint(Arrays.asList("foo", "bar", "baz"));
          container.setExtraClasspath(Arrays.asList("/d1", "/d2", "/d3"));
          container.setExpandClasspathDependencies(true);
          container.setMainClass("mainClass");
          container.setArgs(Arrays.asList("arg1", "arg2", "arg3"));
          container.setPorts(Arrays.asList("1000", "2000-2010", "3000"));
          container.setFormat(ImageFormat.OCI);
          container.setAppRoot("some invalid appRoot value");
          container.getFilesModificationTime().set("some invalid time value");
          container.getCreationTime().set("some other invalid time value");
        });
    ContainerParameters container = testJibExtension.getContainer();
    assertThat(container.getEntrypoint()).containsExactly("foo", "bar", "baz").inOrder();
    assertThat(container.getJvmFlags()).containsExactly("jvmFlag1", "jvmFlag2").inOrder();
    assertThat(container.getEnvironment())
        .containsExactly("var1", "value1", "var2", "value2")
        .inOrder();
    assertThat(container.getExtraClasspath()).containsExactly("/d1", "/d2", "/d3").inOrder();
    assertThat(testJibExtension.getContainer().getExpandClasspathDependencies()).isTrue();
    assertThat(testJibExtension.getContainer().getMainClass()).isEqualTo("mainClass");
    assertThat(container.getArgs()).containsExactly("arg1", "arg2", "arg3").inOrder();
    assertThat(container.getPorts()).containsExactly("1000", "2000-2010", "3000").inOrder();
    assertThat(container.getFormat()).isSameInstanceAs(ImageFormat.OCI);
    assertThat(container.getAppRoot()).isEqualTo("some invalid appRoot value");
    assertThat(container.getFilesModificationTime().get()).isEqualTo("some invalid time value");
    assertThat(container.getCreationTime().get()).isEqualTo("some other invalid time value");
    testJibExtension.container(
        extensionContainer -> {
          extensionContainer.getFilesModificationTime().set((String) null);
          extensionContainer.getCreationTime().set((String) null);
        });
    container = testJibExtension.getContainer();
    assertThat(container.getFilesModificationTime().get()).isEqualTo("EPOCH_PLUS_SECOND");
    assertThat(container.getCreationTime().get()).isEqualTo("EPOCH");
  }