@Test
  public void testDifferentCounts() throws Exception {
    mvcc.advanceTo(1);

    for (int i = 0; i < nbRows; i++) {
      appendToLogAndSync(walEditKVs);
    }

    log.rollWriter();

    try (WALEntryStream entryStream =
      new WALEntryStream(logQueue, fs, CONF, 0, log, new MetricsSource("1"), fakeWalGroupId)) {
      int i = 0;
      while (entryStream.hasNext() == HasNext.YES) {
        assertNotNull(entryStream.next());
        i++;
      }
      assertEquals(nbRows, i);

      // should've read all entries, and since the last file is still opened for writing so we will
      // get a RETRY instead of NO here
      assertEquals(HasNext.RETRY, entryStream.hasNext());
    }
  }
Try out different combinations of row count and KeyValue count
hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestWALEntryStreamDifferentCounts.java