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