public boolean shouldBeCoordinator(ID who) {
    Iterator<ID> it = members.iterator();
    ID firstNonPreferred = null;
    while (it.hasNext()) {
      ID mbr = it.next();
      if (mbr.preferredForCoordinator()) {
        return mbr.equals(who);
      } else if (firstNonPreferred == null) {
        firstNonPreferred = mbr;
      }
    }
    return (firstNonPreferred == null || firstNonPreferred.equals(who));
  }
check to see if the given address is next in line to be coordinator
geode-membership/src/main/java/org/apache/geode/distributed/internal/membership/gms/GMSMembershipView.java