code: public static Set<Event> evaluateEventForProviderInContext(final Principal principal,
                                                                 final RegisteredService service,
                                                                 final Optional<RequestContext> context,
                                                                 final MultifactorAuthenticationProvider provider) {
          LOGGER.debug("Attempting check for availability of multifactor authentication provider [{}] for [{}]", provider, service);
          if (provider != null) {
              LOGGER.debug("Provider [{}] is successfully verified", provider);
              val id = provider.getId();
              val event = MultifactorAuthenticationUtils.validateEventIdForMatchingTransitionInContext(id, context,
                  MultifactorAuthenticationUtils.buildEventAttributeMap(principal, Optional.of(service), provider));
              return CollectionUtils.wrapSet(event);
          }
          LOGGER.debug("Provider could not be verified");
          return new HashSet<>(0);
      }
docs: Evaluate event for provider in context set.
  
  @param principal the principal
  @param service   the service
  @param context   the context
  @param provider  the provider
  @return the set