### Question:
NetUtil { public static InetSocketAddress toAddress(String address) { int i = address.indexOf(':'); String host; int port; if (i > -1) { host = address.substring(0, i); port = Integer.parseInt(address.substring(i + 1)); } else { host = address; port = 0; } return new InetSocketAddress(host, port); }  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 testToAddress() { String address = "1.2.3.4:66"; try { NetUtil.toAddress(address); } catch(Exception e) { Assert.fail(); } String illegalAddress = ".5:33"; try { NetUtil.toAddress(illegalAddress); } catch(Exception e) { Assert.fail(); } }