private void createFiles(FileSystem fs, Path parentDir, int numOfFiles) throws IOException {
    for (int i = 0; i < numOfFiles; i++) {
      // size of each file is 1M, 2M, or 3M
      int xMega = 1 + ThreadLocalRandom.current().nextInt(1, 4);
      byte[] M = new byte[Math.toIntExact(FileUtils.ONE_MB * xMega)];
      Bytes.random(M);
      try (FSDataOutputStream fsdos = fs.create(new Path(parentDir, "file-" + i))) {
        fsdos.write(M);
      }
    }
  }
This tests verifies LogCleaner works correctly with WALs and Procedure WALs located in the same
oldWALs directory.
<p/>
Created files:
<ul>
<li>2 invalid files</li>
<li>5 old Procedure WALs</li>
<li>30 old WALs from which 3 are in replication</li>
<li>5 recent Procedure WALs</li>
<li>1 recent WAL</li>
<li>1 very new WAL (timestamp in future)</li>
<li>masterProcedureWALs subdirectory</li>
</ul>
Files which should stay:
<ul>
<li>3 replication WALs</li>
<li>2 new WALs</li>
<li>5 latest Procedure WALs</li>
<li>masterProcedureWALs subdirectory</li>
</ul>
hbase-server/src/test/java/org/apache/hadoop/hbase/master/cleaner/TestLogsCleaner.java