### Question:
NetUtil { public static String toIpPort(InetSocketAddress address) { if (address == null) { return Constants.UNKNOWN; } return address.getAddress().getHostAddress() + Constants.COLON + address.getPort(); }  static String getLocalHost(); static InetAddress getLocalAddress(); static InetAddress getLocalIpV4Adress(); static String getIpByHost(String hostName); static String toIpPort(InetSocketAddress address); static String toIP(InetSocketAddress address); static int toPort(InetSocketAddress address); static String toHostPort(InetSocketAddress address); static InetSocketAddress toAddress(String address); static int getAvailablePort(int defaultPort); static boolean isIpPortStr(String str); static boolean isPortInUse(int port); static final String LOCAL_HOST; static final String ANY_HOST; static final int MAX_PORT; }### Answer:
@Test public void testToIpPort() { try { String ipPort = NetUtil.toIpPort(new InetSocketAddress(2222)); Assert.assertTrue("0.0.0.0:2222".equals(ipPort)); } catch(Exception e) { Assert.fail(); } }