private String displaySerialQueueContent(InternalGatewaySender sender) {
    StringBuilder message = new StringBuilder();
    message
        .append("Is Primary: ")
        .append(sender.isPrimary())
        .append(", ")
        .append("Queue Size: ")
        .append(sender.getEventQueueSize());

    if (sender.getQueues() != null) {
      message
          .append(", ")
          .append("Queue Count: ")
          .append(sender.getQueues().size());

      List<Object> list = sender.getQueues().stream()
          .<Object>map(regionQueue -> ((SerialGatewaySenderQueue) regionQueue).displayContent())
          .collect(toList());

      message
          .append(", ")
          .append("Keys: ")
          .append(list);
    }

    AbstractGatewaySenderEventProcessor abstractProcessor = sender.getEventProcessor();
    if (abstractProcessor == null) {
      message
          .append(", ")
          .append("Null Event Processor: ");
    }
    if (!sender.isPrimary()) {
      message
          .append(lineSeparator())
          .append("Unprocessed Events: ")
          .append(abstractProcessor.printUnprocessedEvents())
          .append(lineSeparator());
      message
          .append(lineSeparator())
          .append("Unprocessed Tokens: ")
          .append(abstractProcessor.printUnprocessedTokens())
          .append(lineSeparator());
    }

    return message.toString();
  }
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