Even better:
for (Address addr : localDevice.getAllLocalAddresses()) {
if (addr.getMacAddress().equals(from.getMacAddress()))
// This is a local address, so ignore.
return;
}
LOGGER.warning("Another instance with my device instance ID found!");