private void validateSenderOperations(String senderId) {
    GatewaySender sender = findGatewaySender(senderId);

    assertThat(sender.isPaused())
        .isFalse();
    assertThat(sender.isRunning())
        .isFalse();

    sender.pause();

    assertThat(sender.isPaused())
        .isFalse();
    assertThat(sender.isRunning())
        .isFalse();

    sender.resume();

    assertThat(sender.isPaused())
        .isFalse();
    assertThat(sender.isRunning())
        .isFalse();

    sender.stop();

    assertThat(sender.isPaused())
        .isFalse();
    assertThat(sender.isRunning())
        .isFalse();
  }
Since the sender is attached to a region and in use, it can not be destroyed. Hence, exception
is thrown by the sender API.
geode-wan/src/distributedTest/java/org/apache/geode/internal/cache/wan/serial/SerialGatewaySenderOperationsDistributedTest.java