private void waitNumRolledLogFiles(WAL wal, int expected) {
    TEST_UTIL.waitFor(5000, () -> AbstractFSWALProvider.getNumRolledLogFiles(wal) == expected);
  }
helper method to simulate region flush for a WAL.
hbase-server/src/test/java/org/apache/hadoop/hbase/wal/TestFSHLogProvider.java