@Test
  public void testCheckIfAvailableWithSimulatedHeartBeat() throws Exception {
    GMSMembershipView v = installAView();

    MemberIdentifier memberToCheck = mockMembers.get(1);
    HeartbeatMessage fakeHeartbeat = new HeartbeatMessage();
    fakeHeartbeat.setSender(memberToCheck);
    when(messenger.send(any(HeartbeatRequestMessage.class))).then((Answer) invocation -> {
      gmsHealthMonitor.processMessage(fakeHeartbeat);
      return null;
    });

    boolean retVal = gmsHealthMonitor.checkIfAvailable(memberToCheck, "Not responding", true);
    assertTrue("CheckIfAvailable should have return true", retVal);
  }
Send remove member message after doing final check for coordinator, ping timeout This test
trying to remove coordinator
geode-membership/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/fd/GMSHealthMonitorJUnitTest.java