code: public static Collection<InetAddress> getAllLocalIPs() throws SocketException {
          final List<InetAddress> listAdr = new ArrayList<>();
          final Enumeration<NetworkInterface> nifs = NetworkInterface.getNetworkInterfaces();
          if (nifs == null) {
              return listAdr;
          }
  
          while (nifs.hasMoreElements()) {
              final NetworkInterface nif = nifs.nextElement();
              // We ignore subinterfaces - as not yet needed.
  
              final Enumeration<InetAddress> adrs = nif.getInetAddresses();
              while (adrs.hasMoreElements()) {
                  final InetAddress adr = adrs.nextElement();
                  if (getLocalIpFilter().use(nif, adr)) {
                      listAdr.add(adr);
                  }
              }
          }
          return listAdr;
      }
docs: based on http://pastebin.com/5X073pUc
  <p>
  
  Returns all available IP addresses.
  <p>
  In error case or if no network connection is established, we return
  an empty list here.
  <p>
  Loopback addresses are excluded - so 127.0.0.1 will not be never
  returned.
  <p>
  The "primary" IP might not be the first one in the returned list.
  
  @return  Returns all IP addresses (can be an empty list in error case
  or if network connection is missing).
  @see <a href="http://pastebin.com/5X073pUc">getAllLocalIPs</a>
  @see <a href="https://github.com/apache/curator/blob/master/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/ServiceInstanceBuilder.java">ServiceInstanceBuilder.java</a>
  @throws SocketException errors