public static boolean addExchangedLocators(Map<Integer, Set<DistributionLocatorId>> locators,
      LocatorMembershipListener locatorListener) {

    ConcurrentMap<Integer, Set<DistributionLocatorId>> allLocators =
        locatorListener.getAllLocatorsInfo();
    if (!allLocators.equals(locators)) {
      for (Map.Entry<Integer, Set<DistributionLocatorId>> entry : locators.entrySet()) {
        Set<DistributionLocatorId> existingValue = allLocators.putIfAbsent(entry.getKey(),
            new CopyOnWriteHashSet<>(entry.getValue()));

        if (existingValue != null) {
          Set<DistributionLocatorId> localLocators = allLocators.get(entry.getKey());
          if (!localLocators.equals(entry.getValue())) {
            entry.getValue().removeAll(localLocators);
            for (DistributionLocatorId locator : entry.getValue()) {
              if (!locator.getMemberName().equals(DistributionConfig.DEFAULT_NAME)
                  && !localLocators.isEmpty()) {
                DistributionLocatorId existingLocator =
                    getLocatorWithSameMemberName(localLocators, locator);

                // if locator received in response, is already stored in local collection,
                // ignore this info
                if (existingLocator != null) {
                  continue;
                }

              }
              localLocators.add(locator);
              addServerLocator(entry.getKey(), locatorListener, locator);
              locatorListener.locatorJoined(entry.getKey(), locator, null);
            }
          }

        } else {
          for (DistributionLocatorId locator : entry.getValue()) {
            addServerLocator(entry.getKey(), locatorListener, locator);
            locatorListener.locatorJoined(entry.getKey(), locator, null);
          }
        }
      }
      return true;
    }
    return false;
  }
This method adds the map of locators info sent by other locator to this locator's
allLocatorInfo
geode-wan/src/main/java/org/apache/geode/cache/wan/internal/client/locator/LocatorHelper.java