code: protected Pair<Set<Event>, Collection<MultifactorAuthenticationProvider>> filterEventsByMultifactorAuthenticationProvider(
          final Set<Event> resolveEvents, final Authentication authentication,
          final RegisteredService registeredService, final HttpServletRequest request) {
          LOGGER.debug("Locating multifactor providers to determine support for this authentication sequence");
          val providers = MultifactorAuthenticationUtils.getAvailableMultifactorAuthenticationProviders(
              getWebflowEventResolutionConfigurationContext().getApplicationContext());
  
          if (providers.isEmpty()) {
              LOGGER.debug("No providers are available to honor this request. Moving on...");
              return Pair.of(resolveEvents, new HashSet<>(0));
          }
  
          val providerValues = providers.values();
  
          providerValues.removeIf(p -> resolveEvents.stream().noneMatch(e -> p.matches(e.getId())));
          resolveEvents.removeIf(e -> providerValues.stream().noneMatch(p -> p.matches(e.getId())));
  
          LOGGER.debug("Finalized set of resolved events are [{}]", resolveEvents);
          return Pair.of(resolveEvents, providerValues);
      }
docs: Filter events by multifactor authentication providers.
  
  @param resolveEvents     the resolve events
  @param authentication    the authentication
  @param registeredService the registered service
  @param request           the request
  @return the set of events