code: @Override
      public int compare(String loc1, String loc2) {
          int result = 0;
  
          try {
              InetAddress addr1 = InetAddress.getByName(loc1);
              InetAddress addr2 = InetAddress.getByName(loc2);
  
              if (addr1 == addr2) {
                  result = 0;
              } else if (addr1.isLoopbackAddress()) {
                  result = -1;
              } else if (addr2.isLoopbackAddress()) {
                  result = 1;
              } else if (addr1.getHostAddress().equals(hostname.getHostAddress())) {
                  result = -1;
              } else if (addr2.getHostAddress().equals(hostname.getHostAddress())) {
                  result = 1;
              }
  
          } catch (UnknownHostException e) {
              throw new DeepIOException(e);
          }
  
          return result;
      }
docs: {@inheritDoc}