private static void waitUntilWaiting(StatMonitorNotifier notifier) throws InterruptedException {
    boolean done = false;
    for (StopWatch time = new StopWatch(true); !done && time.elapsedTimeMillis() < 2000; done =
        (notifier.isWaiting())) {
      Thread.sleep(10);
    }
    assertTrue("waiting for notifier to be waiting", done);
  }
Extracted tests from StatMonitorHandlerTest that require enableMonitorThread
geode-core/src/test/java/org/apache/geode/internal/statistics/StatMonitorHandlerWithEnabledMonitorThreadTest.java