private void createClientWithLocator(int locatorPort, String hostName) {
    Properties props = getDistributedSystemProperties();

    props.setProperty(MCAST_PORT, "0");
    props.setProperty(LOCATORS, "");

    getCache(props);

    CacheServerTestUtil.disableShufflingOfEndpoints();
    try {
      PoolManager.createFactory()
          .addLocator(hostName, locatorPort)
          .setPingInterval(250)
          .setSubscriptionEnabled(true)
          .setSubscriptionRedundancy(-1)
          .setReadTimeout(20000)
          .setSocketBufferSize(1000)
          .setMinConnections(6)
          .setMaxConnections(10)
          .setRetryAttempts(3)
          .create("pool");
    } finally {
      CacheServerTestUtil.enableShufflingOfEndpoints();
    }
  }
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