code: public void check() {
          List<InetSocketAddress> newAddrs = getAddresses();
          if (newAddrs != null && !newAddrs.equals(currentAddrs)) {
  
              if (addressChangeListener != null) {
                  currentAddrs = newAddrs;
                  addressChangeListener.changeAddresses(newAddrs);
              } else {
                  LOGGER.error("Address change listener is null for JNDI key {}, cannot notify about new value {}", getJndiKey(), newAddrs);
              }
          }
      }
docs: Check if current value bounded to JNDI key is different than previous, if yes then invoked
  {@link AddressChangeListener#changeAddresses(List)} method.