@Test
  public void testEnsureMethodsCalledWhenClosing() throws Exception {
    try (MockedConstruction<DummyDFSOutputStream> mocked =
      mockConstruction(DummyDFSOutputStream.class)) {
      try (FanOutOneBlockAsyncDFSOutput out = create("/methods_for_closing")) {
        DummyDFSOutputStream dummy = mocked.constructed().get(0);
        verifyGetUniqKey(dummy);
        FS.getClient().closeAllFilesBeingWritten(false);
        verify(dummy).close();

        verifyNoMoreInteractions(dummy);
      }
    }
  }
Make sure lease renewal works. Since it is in a background thread, normal read/write test can not
verify it.
<p>
See HBASE-28955 for more details.
hbase-asyncfs/src/test/java/org/apache/hadoop/hbase/io/asyncfs/TestLeaseRenewal.java