@Override
      public void run() {
        heart.sendPeriodicHeartbeats(sleepMillis -> {
        },
            () -> {
              switch (periodNumber++) {
                case 0:
                  return 0L;
                case 1:
                default:
                  gmsHealthMonitor.stop();
                  return actualSleepPeriod.applyAsLong(heart.sleepLimitNanos);
              }
            },
            msg -> capturedMessage = msg);
        assertThat(capturedMessage).isEqualTo(expectedLogWarning);
      }
Same test as above but with request to initiate removal
geode-membership/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/fd/GMSHealthMonitorJUnitTest.java