@@ -0,0 +1,1136 @@
+package com.github.dockerjava.api.model;%0A%0Aimport static org.testng.Assert.assertEquals;%0A%0Aimport java.util.Map;%0A%0Aimport org.testng.annotations.Test;%0A%0Aimport com.fasterxml.jackson.databind.ObjectMapper;%0Aimport com.github.dockerjava.api.model.Ports.Binding;%0A%0Apublic class PortsTest %7B%0A%09private final ObjectMapper objectMapper = new ObjectMapper();%0A%0A%09@Test%0A%09public void deserializingPortWithMultipleBindingsReturnsFirstBinding() throws Exception %7B%0A%09%09String json = %22%7B%5C%2280/tcp%5C%22:%5B%7B%5C%22HostIp%5C%22:%5C%2210.0.0.1%5C%22,%5C%22HostPort%5C%22:%5C%2280%5C%22%7D,%7B%5C%22HostIp%5C%22:%5C%2210.0.0.2%5C%22,%5C%22HostPort%5C%22:%5C%2280%5C%22%7D%5D%7D%22;%0A%09%09Ports ports = objectMapper.readValue(json, Ports.class);%0A%09%09Map%3CExposedPort, Binding%3E bindings = ports.getBindings();%0A%09%09assertEquals(bindings.size(), 1);%0A%0A%09%09Binding binding = bindings.get(ExposedPort.tcp(80));%0A%09%09assertEquals(binding, new Binding(%2210.0.0.1%22, 80));%0A%09%7D%0A%09%0A%09@Test%0A%09public void serializePort() throws Exception %7B%0A%09%09Ports ports = new Ports(ExposedPort.tcp(80), new Binding(%2210.0.0.1%22, 80));%0A%09%09String expectedJson = %22%7B%5C%2280/tcp%5C%22:%5B%7B%5C%22HostIp%5C%22:%5C%2210.0.0.1%5C%22,%5C%22HostPort%5C%22:%5C%2280%5C%22%7D%5D%7D%22;%0A%09%09assertEquals(objectMapper.writeValueAsString(ports), expectedJson);%0A%09%7D%0A%09%0A%7D%0A

Document current deserialization of Ports with a test