### Question:
NetUtil { public static InetSocketAddress toInetSocketAddress(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 toStringAddress(SocketAddress address); static String toIpAddress(SocketAddress address); static String toStringAddress(InetSocketAddress address); static InetSocketAddress toInetSocketAddress(String address); static long toLong(String address); static String getLocalIp(); static String getLocalHost(); static InetAddress getLocalAddress(); static void validAddress(InetSocketAddress address); static boolean isValidIp(String ip, boolean validLocalAndAny);  }### Answer:
@Test public void testToInetSocketAddress() { try { NetUtil.toInetSocketAddress("23939:ks"); } catch (Exception e) { assertThat(e).isInstanceOf(NumberFormatException.class); } }
@Test public void testToInetSocketAddress1() { assertThat(NetUtil.toInetSocketAddress("kadfskl").getHostName()).isEqualTo("kadfskl"); }