private void validateSubstitutionFilterInvocations(int expectedNumInvocations) {
    // Verify the GatewayEventSubstitutionFilter has been invoked the appropriate number of times
    StringGatewayEventSubstitutionFilter gatewayEventSubstitutionFilter =
        getMyGatewayEventSubstitutionFilter();
    assertThat(gatewayEventSubstitutionFilter.getNumInvocations())
        .isEqualTo(expectedNumInvocations);

    // Verify the AsyncEventListener has received the substituted values
    SpyAsyncEventListener asyncEventListener = getSpyAsyncEventListener();
    Map<Integer, String> eventsMap = asyncEventListener.getEventsMap();
    assertThat(eventsMap).isNotNull().hasSize(expectedNumInvocations);

    for (Map.Entry<Integer, String> entry : eventsMap.entrySet()) {
      assertThat(entry.getValue()).isEqualTo(SUBSTITUTION_PREFIX + entry.getKey());
    }
  }
Override as needed to add to the configuration, such as regionFactory.setOffHeap(boolean).
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/wan/asyncqueue/AsyncEventListenerWithFilterDistributedTest.java