private boolean isNewerProfile(Profile newProfile, Profile oldProfile) {
    Assert.assertHoldsLock(this, true);
    boolean isNewer = true;

    // force version comparison
    int oldSerial = oldProfile.getSerialNumber();
    int newSerial = newProfile.getSerialNumber();
    // boolean serialRolled = oldSerial > 0 && newSerial < 0;
    boolean serialRolled =
        oldSerial > ROLLOVER_THRESHOLD_UPPER && newSerial < ROLLOVER_THRESHOLD_LOWER;

    int oldVersion = oldProfile.getVersion();
    int newVersion = newProfile.getVersion();
    // boolean versionRolled = oldVersion > 0 && newVersion < 0;
    boolean versionRolled =
        oldVersion > ROLLOVER_THRESHOLD_UPPER && newVersion < ROLLOVER_THRESHOLD_LOWER;

    boolean newIsNewer;
    if (oldSerial == newSerial) {
      // if region serial is same, compare versions
      newIsNewer = versionRolled || oldVersion < newVersion;
    } else {
      // compare region serial
      newIsNewer = serialRolled || oldSerial < newSerial;
    }
    if (!newIsNewer) {
      isNewer = false;
    }
    return isNewer;
  }
Returns true if newProfile is newer than oldProfile. This is determined by comparing
{@link Profile#getSerialNumber()} and {@link Profile#getVersion()}. If the old versioning
number being compared is above {@link #ROLLOVER_THRESHOLD_UPPER} and the new versioning number
is below {@link #ROLLOVER_THRESHOLD_LOWER} then a rollover is assumed to have occurred, which
means the new versioning number is newer.

@param newProfile the newer profile
@param oldProfile the older profile
@return true if newProfile is newer than oldProfile
geode-core/src/main/java/org/apache/geode/distributed/internal/DistributionAdvisor.java