@Test
  public void testParallelGWSenderUpdateFiltersWhilePutting() throws Exception {
    Integer[] locatorPorts = createLNAndNYLocators();
    Integer lnPort = locatorPorts[0];
    Integer nyPort = locatorPorts[1];

    List<GatewayEventFilter> filters = new ArrayList<>();
    filters.add(new MyGatewayEventFilter_AfterAck());
    filters.add(new PDXGatewayEventFilter());

    List<GatewayEventFilter> filters2 = new ArrayList<>();
    filters.add(new MyGatewayEventFilter());
    filters.add(new MyGatewayEventFilter_AfterAck());
    filters.add(new PDXGatewayEventFilter());

    createCacheInVMs(nyPort, vm2, vm3);
    createReceiverInVMs(vm2, vm3);

    createCacheInVMs(lnPort, vm4, vm5, vm6, vm7);

    vm4.invoke(() -> createSender("ln", 2, true, 100, 10, false, false, null, false));
    vm5.invoke(() -> createSender("ln", 2, true, 100, 10, false, false, null, false));
    vm6.invoke(() -> createSender("ln", 2, true, 100, 10, false, false, null, false));
    vm7.invoke(() -> createSender("ln", 2, true, 100, 10, false, false, null, false));

    createPartitionedRegions(false);

    vm4.invoke(() -> waitForSenderRunningState("ln"));
    vm5.invoke(() -> waitForSenderRunningState("ln"));
    vm6.invoke(() -> waitForSenderRunningState("ln"));
    vm7.invoke(() -> waitForSenderRunningState("ln"));

    AsyncInvocation<Void> async = vm4.invokeAsync(() -> doPuts(getUniqueName() + "_PR", 5000));
    checkBatchSize(10);

    updateBatchSize(100);
    updateGatewayEventFilters(filters);
    checkBatchSize(100);
    updateGatewayEventFilters(filters2);

    async.await();

  }
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/parallel/ParallelGatewaySenderOperationsDistributedTest.java