private static DistributionLocatorId getLocatorFromCollection(
      Set<DistributionLocatorId> locatorSet, DistributionLocatorId locator) {
    for (DistributionLocatorId locElement : locatorSet) {
      if (locator.equals(locElement)) {
        return locElement;
      }
    }
    return null;
  }
This method gets locator equal to specified from collection of locators
geode-wan/src/main/java/org/apache/geode/cache/wan/internal/client/locator/LocatorHelper.java