docs: public static <ResType> Iterable<ResType> filterAuthorizedResources(
        final AuthenticationResult authenticationResult,
        final Iterable<ResType> resources,
        final Function<? super ResType, Iterable<ResourceAction>> resourceActionGenerator,
        final AuthorizerMapper authorizerMapper
    )
    {
      final Authorizer authorizer = authorizerMapper.getAuthorizer(authenticationResult.getAuthorizerName());
      if (authorizer == null) {
        throw new ISE("No authorizer found with name: [%s].", authenticationResult.getAuthorizerName());
      }
  
      final Map<ResourceAction, Access> resultCache = new HashMap<>();
      final Iterable<ResType> filteredResources = Iterables.filter(
          resources,
          resource -> {
            final Iterable<ResourceAction> resourceActions = resourceActionGenerator.apply(resource);
            if (resourceActions == null) {
              return false;
            }
            for (ResourceAction resourceAction : resourceActions) {
              Access access = resultCache.computeIfAbsent(
                  resourceAction,
                  ra -> authorizer.authorize(
                      authenticationResult,
                      ra.getResource(),
                      ra.getAction()
                  )
              );
              if (!access.isAllowed()) {
                return false;
              }
            }
            return true;
          }
      );
  
      return filteredResources;
    }