### Question:
NetUtils { public static InetSocketAddress getLocalSocketAddress(String host, int port) { return isInvalidLocalHost(host) ? new InetSocketAddress(port) : new InetSocketAddress(host, port); }  static int getRandomPort(); static int getAvailablePort(); static int getAvailablePort(int port); static boolean isInvalidPort(int port); static boolean isValidAddress(String address); static boolean isLocalHost(String host); static boolean isAnyHost(String host); static boolean isInvalidLocalHost(String host); static boolean isValidLocalHost(String host); static InetSocketAddress getLocalSocketAddress(String host, int port); static String getLocalHost(); static String filterLocalHost(String host); static InetAddress getLocalAddress(); static String getHostName(String address); static String getIpByHost(String hostName); static String toAddressString(InetSocketAddress address); static InetSocketAddress toAddress(String address); static String toURL(String protocol, String host, int port, String path);  }### Answer:
@Test public void testGetLocalSocketAddress() throws Exception { InetSocketAddress address = NetUtils.getLocalSocketAddress("localhost", 12345); assertTrue(address.getAddress().isAnyLocalAddress()); assertEquals(address.getPort(), 12345); address = NetUtils.getLocalSocketAddress("dubbo-addr", 12345); assertEquals(address.getHostName(), "dubbo-addr"); assertEquals(address.getPort(), 12345); }