private static void waitForNotificationCount(final TestStatisticsMonitor monitor,
      final int expected, long ms, long interval, boolean throwOnTimeout)
      throws InterruptedException {
    boolean done = false;
    for (StopWatch time = new StopWatch(true); !done && time.elapsedTimeMillis() < ms; done =
        (monitor.getNotificationCount() >= expected)) {
      Thread.sleep(interval);
    }
    if (throwOnTimeout) {
      assertTrue("waiting for notification count to be " + expected, done);
    }
  }
Unit tests for {@link StatMonitorHandler}.

@since GemFire 7.0
geode-core/src/test/java/org/apache/geode/internal/statistics/StatMonitorHandlerTest.java