@Override
    public void afterCreate(EntryEvent event) {
      synchronized (dummyObj) {
        try {
          Object value = event.getNewValue();
          if (value.equals(VALUE1)) {
            waitFlag = false;
            dummyObj.notifyAll();
          }
        } catch (Exception e) {
          e.printStackTrace();
        }
      }
    }
This is the client listener which notifies the waiting thread when it receives the event.
geode-cq/src/distributedTest/java/org/apache/geode/internal/cache/ha/HADispatcherDistributedTest.java