code: private InterfaceAddress findMatchingAddress(DeviceAnnouncement aDevice, NetworkInterface networkInterface) {
          for (InterfaceAddress address : networkInterface.getInterfaceAddresses()) {
              if ((address.getBroadcast() != null) &&
                      Util.sameNetwork(address.getNetworkPrefixLength(), aDevice.getAddress(), address.getAddress())) {
                  return address;
              }
          }
          return null;
      }
docs: Scan a network interface to find if it has an address space which matches the device we are trying to reach.
  If so, return the address specification.
  
  @param aDevice the DJ Link device we are trying to communicate with
  @param networkInterface the network interface we are testing
  @return the address which can be used to communicate with the device on the interface, or null