private String checkAccessControlEnforcerSlowness(
      long elapsedMs, AccessControlEnforcer ace,
      boolean checkSuperuser, AuthorizationContext context) {
    return checkAccessControlEnforcerSlowness(elapsedMs,
        accessControlEnforcerReportingThresholdMs, ace.getClass(), checkSuperuser,
        context.getPath(), context.getOperationName(),
        context.getCallerContext());
  }
@Test
  public void testCheckAccessControlEnforcerSlowness() throws Exception {
    final long thresholdMs = 10;
    final LongFunction<String> checkAccessControlEnforcerSlowness =
        elapsedMs -> FSPermissionChecker.checkAccessControlEnforcerSlowness(
            elapsedMs, thresholdMs, INodeAttributeProvider.AccessControlEnforcer.class,
            false, "/foo", "mkdir", "client");

    final String m1 = FSPermissionChecker.runCheckPermission(
        () -> FSPermissionChecker.LOG.info("Fast runner"),
        checkAccessControlEnforcerSlowness);
    Assert.assertNull(m1);

    final String m2 = FSPermissionChecker.runCheckPermission(() -> {
      FSPermissionChecker.LOG.info("Slow runner");
      try {
        Thread.sleep(20);
      } catch (InterruptedException e) {
        Thread.currentThread().interrupt();
        throw new IllegalStateException(e);
      }
    }, checkAccessControlEnforcerSlowness);
    Assert.assertNotNull(m2);
  }