protected Set<Event> resolveEventsInternal(final Collection<Event> resolveEvents,
                                               final Authentication authentication,
                                               final RegisteredService registeredService,
                                               final HttpServletRequest request,
                                               final RequestContext context,
                                               final Service service) throws Throwable {
        if (resolveEvents.isEmpty()) {
            LOGGER.trace("No events resolved for authentication transaction [{}] and service [{}]",
                authentication, registeredService);
        } else {
            LOGGER.trace("Collection of resolved events for this authentication sequence are:");
            resolveEvents.forEach(e -> LOGGER.trace("Event id [{}] resolved from [{}]",
                e.getId(), e.getSource().getClass().getName()));
        }
        val result = filterEventsByMultifactorAuthenticationProvider(resolveEvents, authentication, registeredService, request, service);
        return result.map(pair -> {
            MultifactorAuthenticationWebflowUtils.putResolvedMultifactorAuthenticationProviders(context, pair.getValue());
            return new HashSet<>(pair.getKey());
        }).orElseGet(HashSet::new);
    }
Resolve events internal set. Implementation may filter events from the collection
to only return the one that is appropriate for this request. The default
implementation returns the entire collection.

@param resolveEvents     the resolve events
@param authentication    the authentication
@param registeredService the registered service
@param request           the request
@param context           the request context
@param service           the service
@return the set of resolved events
core/cas-server-core-webflow-mfa-api/src/main/java/org/apereo/cas/web/flow/resolver/impl/SelectiveMultifactorAuthenticationProviderWebflowEventResolver.java