IpUtils { public static String getInetIp() { List<String> ips = getInetIps(); for (String ip : ips) { if (!"127.0.0.1".equals(ip)) { return ip; } } return "127.0.0.1"; } private  IpUtils(); @SuppressWarnings("unchecked") static Map<String, String> getAllInfo(String ip); static String getCountry(String ip); static String getArea(String ip); static String getRegion(String ip); static String getCity(String ip); static String getIsp(String ip); static String getCounty(String ip); static String get(String ip, IpKey key); static String getInetIp(); static List<String> getInetIps();  }
@Test public void testGetInetIp(){ Assert.assertNotNull(IpUtils.getInetIp()); }