### Question:
DockerInspectCommand extends DockerCommand { public DockerInspectCommand getIpAndHost() { super.addCommandArguments("format", "{{range(.NetworkSettings.Networks)}}" + "{{.IPAddress}},{{end}}{{.Config.Hostname}}"); this.commandArguments = "--format={{range(.NetworkSettings.Networks)}}" + "{{.IPAddress}},{{end}}{{.Config.Hostname}}"; return this; } DockerInspectCommand(String containerName); DockerInspectCommand getContainerStatus(); DockerInspectCommand getIpAndHost(); DockerInspectCommand get(String[] templates, char delimiter); @Override PrivilegedOperation preparePrivilegedOperation(
      DockerCommand dockerCommand, String containerName, Map<String,
      String> env, Context nmContext); DockerInspectCommand getExposedPorts(); static final String STATUS_TEMPLATE; static final String STOPSIGNAL_TEMPLATE; }### Answer:
@Test public void testGetIpAndHost() throws Exception { dockerInspectCommand.getIpAndHost(); assertEquals("inspect", StringUtils.join(",", dockerInspectCommand.getDockerCommandWithArguments() .get("docker-command"))); assertEquals("{{range(.NetworkSettings.Networks)}}" + "{{.IPAddress}},{{end}}{{.Config.Hostname}}", StringUtils.join(",", dockerInspectCommand.getDockerCommandWithArguments().get("format"))); assertEquals("foo", StringUtils.join(",", dockerInspectCommand.getDockerCommandWithArguments().get("name"))); assertEquals(3, dockerInspectCommand.getDockerCommandWithArguments().size()); }