public void doBackwardCompatibilityCheck(boolean eventsMustExist) {

    Long testEventIdPrev = testEventId.get();
    Long testEventIdNow = getCurrentNotificationId();

    testEventId.set(testEventIdNow);

    if (eventsMustExist){
      assertTrue("New events must exist between old["
          + testEventIdPrev + "] and [" + testEventIdNow + "]",
          testEventIdNow > testEventIdPrev);
    } else if (testEventIdNow <= testEventIdPrev){
      return; // nothing further to test.
    }
    doBackwardCompatibilityCheck(testEventIdPrev,testEventIdNow);
  }
Helper method to verify that all events generated since last call are compatible with
replv1. If this is called multiple times, it does this check for all events incurred
since the last time it was called.

@param eventsMustExist : Determines whether or not non-presence of events should be
  considered an error. You probably don't need this except during test development
  for validation. If you're running this for a whole set of tests in one go, not
  having any events is probably an error condition.
hcatalog/webhcat/java-client/src/test/java/org/apache/hive/hcatalog/api/repl/ReplicationV1CompatRule.java