public static void createClientCache2CommonWriter(String host, Integer port) throws Exception {
    ConflationDistributedTest test = new ConflationDistributedTest();
    cache = test.createCache(createProperties1());
    AttributesFactory factory = new AttributesFactory();
    factory.setScope(Scope.LOCAL);
    factory.setPoolName(createPool(host, "p1", port, true).getName());
    factory.addCacheListener(new CacheListenerAdapter() {
      @Override
      public void afterCreate(EntryEvent event) {
        LogWriterUtils.getLogWriter().info("Listener received event " + event);
        String val = (String) event.getNewValue();
        synchronized (ConflationDistributedTest.class) {
          if (val.equals(MARKER)) {
            count++;
          } else {
            counterCreate++;
          }
          if (2 == count) {
            ConflationDistributedTest.class.notify();
          }
        }
      }

      @Override
      public void afterUpdate(EntryEvent event) {
        LogWriterUtils.getLogWriter().info("Listener received event " + event);
        synchronized (this) {
          counterUpdate++;
        }
      }

      @Override
      public void afterDestroy(EntryEvent event) {
        LogWriterUtils.getLogWriter().info("Listener received event " + event);
        synchronized (this) {
          if (!event.getKey().equals(MARKER)) {
            counterDestroy++;
          }
        }
      }
    });
    RegionAttributes attrs = factory.create();
    cache.createRegion(REGION_NAME1, attrs);
    cache.createRegion(REGION_NAME2, attrs);
  }
create client 2 with 2 regions with sharing a common writer and having a common listener
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/tier/sockets/ConflationDistributedTest.java