@Test
  public void testArriveAtRightAnswer() throws InterruptedException {
    final TimeRangeTracker trr = getTimeRangeTracker();
    final int threadCount = 10;
    final int calls = 1000 * 1000;
    Thread[] threads = new Thread[threadCount];
    for (int i = 0; i < threads.length; i++) {
      Thread t = new Thread("" + i) {
        @Override
        public void run() {
          int offset = Integer.parseInt(getName());
          boolean even = offset % 2 == 0;
          if (even) {
            for (int i = (offset * calls); i < calls; i++) {
              trr.includeTimestamp(i);
            }
          } else {
            int base = offset * calls;
            for (int i = base + calls; i >= base; i--) {
              trr.includeTimestamp(i);
            }
          }
        }
      };
      t.start();
      threads[i] = t;
    }
    for (int i = 0; i < threads.length; i++) {
      threads[i].join();
    }

    assertTrue(trr.getMax() == calls * threadCount);
    assertTrue(trr.getMin() == 0);
  }
Run a bunch of threads against a single TimeRangeTracker and ensure we arrive at right range.
Here we do ten threads each incrementing over 100k at an offset of the thread index; max is 10
* 10k and min is 0.
hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSyncTimeRangeTracker.java