@Test
  public void testEnsureMethodsCalledWhenLeaseRenewal() throws Exception {
    try (MockedConstruction<DummyDFSOutputStream> mocked =
      mockConstruction(DummyDFSOutputStream.class)) {
      try (FanOutOneBlockAsyncDFSOutput out = create("/methods_for_lease_renewal")) {
        DummyDFSOutputStream dummy = mocked.constructed().get(0);
        assertTrue(FS.getClient().renewLease());
        Optional<Method> getUniqKeyMethod = getUniqKeyMethod();
        if (getUniqKeyMethod.isPresent()) {
          getUniqKeyMethod.get().invoke(verify(dummy));
          Method getNamespaceMethod = DFSOutputStream.class.getMethod("getNamespace");
          getNamespaceMethod.invoke(verify(dummy));
        } else {
          verify(dummy).getFileId();
        }
        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