public static Builder builder() {
    return new Builder();
  }
@Test
  public void testBuilder_nullValues() {
    // Java arguments element should not be null.
    try {
      ContainerConfiguration.builder().setProgramArguments(Arrays.asList("first", null));
      Assert.fail();
    } catch (IllegalArgumentException ex) {
      Assert.assertEquals("program arguments list contains null elements", ex.getMessage());
    }

    // Entrypoint element should not be null.
    try {
      ContainerConfiguration.builder().setEntrypoint(Arrays.asList("first", null));
      Assert.fail();
    } catch (IllegalArgumentException ex) {
      Assert.assertEquals("entrypoint contains null elements", ex.getMessage());
    }

    // Exposed ports element should not be null.
    Set<Port> badPorts = new HashSet<>(Arrays.asList(Port.tcp(1000), null));
    try {
      ContainerConfiguration.builder().setExposedPorts(badPorts);
      Assert.fail();
    } catch (IllegalArgumentException ex) {
      Assert.assertEquals("ports list contains null elements", ex.getMessage());
    }

    // Volume element should not be null.
    Set<AbsoluteUnixPath> badVolumes =
        new HashSet<>(Arrays.asList(AbsoluteUnixPath.get("/"), null));
    try {
      ContainerConfiguration.builder().setVolumes(badVolumes);
      Assert.fail();
    } catch (IllegalArgumentException ex) {
      Assert.assertEquals("volumes list contains null elements", ex.getMessage());
    }

    Map<String, String> nullKeyMap = new HashMap<>();
    nullKeyMap.put(null, "value");
    Map<String, String> nullValueMap = new HashMap<>();
    nullValueMap.put("key", null);

    // Label keys should not be null.
    try {
      ContainerConfiguration.builder().setLabels(nullKeyMap);
      Assert.fail();
    } catch (IllegalArgumentException ex) {
      Assert.assertEquals("labels map contains null keys", ex.getMessage());
    }

    // Labels values should not be null.
    try {
      ContainerConfiguration.builder().setLabels(nullValueMap);
      Assert.fail();
    } catch (IllegalArgumentException ex) {
      Assert.assertEquals("labels map contains null values", ex.getMessage());
    }

    // Environment keys should not be null.
    try {
      ContainerConfiguration.builder().setEnvironment(nullKeyMap);
      Assert.fail();
    } catch (IllegalArgumentException ex) {
      Assert.assertEquals("environment map contains null keys", ex.getMessage());
    }

    // Environment values should not be null.
    try {
      ContainerConfiguration.builder().setEnvironment(nullValueMap);
      Assert.fail();
    } catch (IllegalArgumentException ex) {
      Assert.assertEquals("environment map contains null values for key(s): key", ex.getMessage());
    }
  }