protected final void checkOrder(int expectedEntries) throws IOException {
    try (WALStreamReader reader =
      NoEOFWALStreamReader.create(UTIL.getTestFileSystem(), logPath, UTIL.getConfiguration())) {
      long seqId = -1L;
      int count = 0;
      for (Entry entry;;) {
        entry = reader.next();
        if (entry == null) {
          break;
        }
        assertTrue(
          "Sequence id go backwards from " + seqId + " to " + entry.getKey().getSequenceId(),
          entry.getKey().getSequenceId() >= seqId);
        seqId = entry.getKey().getSequenceId();
        count++;
      }
      assertEquals(expectedEntries, count);
    }
  }
Base class for testing serial replication.
hbase-server/src/test/java/org/apache/hadoop/hbase/replication/SerialReplicationTestBase.java