@Test public void resolveHostNameTest() throws UnknownHostException { Assert.assertEquals(NetworkUtils.resolveHostName(""), null); Assert.assertEquals(NetworkUtils.resolveHostName(null), null); Assert.assertEquals(NetworkUtils.resolveHostName("localhost"), "localhost"); }
public static String resolveHostName(String hostname) throws UnknownHostException { if (hostname == null || hostname.isEmpty()) { return null; } return InetAddress.getByName(hostname).getCanonicalHostName(); }
NetworkUtils { public static String resolveHostName(String hostname) throws UnknownHostException { if (hostname == null || hostname.isEmpty()) { return null; } return InetAddress.getByName(hostname).getCanonicalHostName(); } }
NetworkUtils { public static String resolveHostName(String hostname) throws UnknownHostException { if (hostname == null || hostname.isEmpty()) { return null; } return InetAddress.getByName(hostname).getCanonicalHostName(); }  }
NetworkUtils { public static String resolveHostName(String hostname) throws UnknownHostException { if (hostname == null || hostname.isEmpty()) { return null; } return InetAddress.getByName(hostname).getCanonicalHostName(); }  static String getLocalHostName(); static String getLocalIpAddress(); static String replaceHostName(String addr); static String resolveHostName(String hostname); }
NetworkUtils { public static String resolveHostName(String hostname) throws UnknownHostException { if (hostname == null || hostname.isEmpty()) { return null; } return InetAddress.getByName(hostname).getCanonicalHostName(); }  static String getLocalHostName(); static String getLocalIpAddress(); static String replaceHostName(String addr); static String resolveHostName(String hostname);  }