### Question:
NetUtils { public static String filterLocalHost(String host) { if (host == null || host.length() == 0) { return host; } if (host.contains(": URL u = URL.valueOf(host); if (NetUtils.isInvalidLocalHost(u.getHost())) { return u.setHost(NetUtils.getLocalHost()).toFullString(); } } else if (host.contains(":")) { int i = host.lastIndexOf(':'); if (NetUtils.isInvalidLocalHost(host.substring(0, i))) { return NetUtils.getLocalHost() + host.substring(i); } } else { if (NetUtils.isInvalidLocalHost(host)) { return NetUtils.getLocalHost(); } } return host; }  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 testFilterLocalHost() throws Exception { assertNull(NetUtils.filterLocalHost(null)); assertEquals(NetUtils.filterLocalHost(""), ""); String host = NetUtils.filterLocalHost("dubbo: assertThat(host, equalTo("dubbo: host = NetUtils.filterLocalHost("127.0.0.1:8080"); assertThat(host, equalTo(NetUtils.getLocalHost() + ":8080")); host = NetUtils.filterLocalHost("0.0.0.0"); assertThat(host, equalTo(NetUtils.getLocalHost())); host = NetUtils.filterLocalHost("88.88.88.88"); assertThat(host, equalTo(host)); }