### Question:
ContainerConfiguration { public static Builder builder() { return new Builder(); } private  ContainerConfiguration(
      ImmutableSet<Platform> platforms,
      Instant creationTime,
      @Nullable ImmutableList<String> entrypoint,
      @Nullable ImmutableList<String> programArguments,
      @Nullable ImmutableMap<String, String> environmentMap,
      @Nullable ImmutableSet<Port> exposedPorts,
      @Nullable ImmutableSet<AbsoluteUnixPath> volumes,
      @Nullable ImmutableMap<String, String> labels,
      @Nullable String user,
      @Nullable AbsoluteUnixPath workingDirectory); static Builder builder(); ImmutableSet<Platform> getPlatforms(); Instant getCreationTime(); @Nullable ImmutableList<String> getEntrypoint(); @Nullable ImmutableList<String> getProgramArguments(); @Nullable ImmutableMap<String, String> getEnvironmentMap(); @Nullable ImmutableSet<Port> getExposedPorts(); @Nullable ImmutableSet<AbsoluteUnixPath> getVolumes(); @Nullable String getUser(); @Nullable ImmutableMap<String, String> getLabels(); @Nullable AbsoluteUnixPath getWorkingDirectory(); @Override @VisibleForTesting boolean equals(Object other); @Override @VisibleForTesting int hashCode();  }### Answer:
@Test public void testBuilder_nullValues() { try { ContainerConfiguration.builder().setProgramArguments(Arrays.asList("first", null)); Assert.fail(); } catch (IllegalArgumentException ex) { Assert.assertEquals("program arguments list contains null elements", ex.getMessage()); } try { ContainerConfiguration.builder().setEntrypoint(Arrays.asList("first", null)); Assert.fail(); } catch (IllegalArgumentException ex) { Assert.assertEquals("entrypoint contains null elements", ex.getMessage()); } 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()); } 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); try { ContainerConfiguration.builder().setLabels(nullKeyMap); Assert.fail(); } catch (IllegalArgumentException ex) { Assert.assertEquals("labels map contains null keys", ex.getMessage()); } try { ContainerConfiguration.builder().setLabels(nullValueMap); Assert.fail(); } catch (IllegalArgumentException ex) { Assert.assertEquals("labels map contains null values", ex.getMessage()); } try { ContainerConfiguration.builder().setEnvironment(nullKeyMap); Assert.fail(); } catch (IllegalArgumentException ex) { Assert.assertEquals("environment map contains null keys", ex.getMessage()); } try { ContainerConfiguration.builder().setEnvironment(nullValueMap); Assert.fail(); } catch (IllegalArgumentException ex) { Assert.assertEquals("environment map contains null values", ex.getMessage()); } }
@Test @SuppressWarnings("JdkObsolete") public void testBuilder_environmentMapTypes() { ContainerConfiguration.builder().setEnvironment(ImmutableMap.of()).build(); ContainerConfiguration.builder().setEnvironment(new TreeMap<>()); ContainerConfiguration.builder().setEnvironment(new Hashtable<>()); }
@Test public void testSetPlatforms_emptySet() { try { ContainerConfiguration.builder().setPlatforms(Collections.emptySet()).build(); Assert.fail(); } catch (IllegalArgumentException ex) { Assert.assertEquals("platforms set cannot be empty", ex.getMessage()); } }