public boolean waitWhileNotEnoughEvents(long sleepMs, int eventCount) {
      long maxMillis = System.currentTimeMillis() + sleepMs;
      synchronized (CONTROL_LOCK) {
        try {
          while (events.size() < eventCount) {
            long waitMillis = maxMillis - System.currentTimeMillis();
            if (waitMillis < 10) {
              break;
            }
            CONTROL_LOCK.wait(waitMillis);
          } // while
        } catch (InterruptedException abort) {
          fail("interrupted");
        }
        return !events.isEmpty();
      } // synchronized
    }
This method is not implemented to test event count matches the eventsToCheck.size() which is
confusing. It will wait and return if it got something in the eventsToCheck or not.
geode-dunit/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheServerTestUtil.java