### Question:
IpUtils { public static String getIp() { if (null != cachedIpAddress) { return cachedIpAddress; } Enumeration<NetworkInterface> netInterfaces; try { netInterfaces = NetworkInterface.getNetworkInterfaces(); } catch (final SocketException ex) { throw new HostException(ex); } String localIpAddress = null; while (netInterfaces.hasMoreElements()) { NetworkInterface netInterface = netInterfaces.nextElement(); Enumeration<InetAddress> ipAddresses = netInterface.getInetAddresses(); while (ipAddresses.hasMoreElements()) { InetAddress ipAddress = ipAddresses.nextElement(); if (isPublicIpAddress(ipAddress)) { String publicIpAddress = ipAddress.getHostAddress(); cachedIpAddress = publicIpAddress; return publicIpAddress; } if (isLocalIpAddress(ipAddress)) { localIpAddress = ipAddress.getHostAddress(); } } } cachedIpAddress = localIpAddress; return localIpAddress; }  static String getIp(); static String getHostName(); static final String IP_REGEX; }### Answer:
@Test public void assertGetIp() { assertNotNull(IpUtils.getIp()); }