### Question:
IpPortAddress implements Serializable { @Override public String toString() { if (textRepresentation == null) { if (ip.length == 4) { textRepresentation = (ip[0] & 0xff) + "." + (ip[1] & 0xff) + "." + (ip[2] & 0xff) + "." + (ip[3] & 0xff) + ":" + port; } else { textRepresentation = ipv6ToString(); } } return textRepresentation; } IpPortAddress(byte[] ip, int port);  IpPortAddress(InetSocketAddress address); static IpPortAddress of(InetSocketAddress address); static IpPortAddress local(int localPort); byte[] getIp(); int getPort(); @Override String toString(); InetSocketAddress toInetSocketAddress(); @Override int hashCode(); @Override boolean equals(Object obj);  }### Answer:
@Test public void toStringTest() { IpPortAddress addr = new IpPortAddress(new InetSocketAddress("[2001::1:0:1234]", 4321)); assertEquals("[2001::1:0:1234]:4321", addr.toString()); assertEquals("[2001::1:0:1234]:4321", new IpPortAddress(new InetSocketAddress("[2001:0000:0000:0000:0000:0001:0000:1234]", 4321)).toString()); addr = new IpPortAddress(new InetSocketAddress("127.0.0.1", 61616)); assertEquals("127.0.0.1:61616", addr.toString()); }