/**
   * Fill in the filter context data.
   *
   * @param profileRequestContext current profile request context
   * @param filterContext context to populate
   */
  private void populateFilterContext(
      @Nonnull final ProfileRequestContext profileRequestContext,
      @Nonnull final AttributeFilterContext filterContext) {

    filterContext.setPrincipal(principalNameLookupStrategy.apply(profileRequestContext));

    filterContext.setPrincipalAuthenticationMethod(null);
    if (null != authenticationContext) {
      final AuthenticationResult result = authenticationContext.getAuthenticationResult();
      if (null != result) {
        filterContext.setPrincipalAuthenticationMethod(result.getAuthenticationFlowId());
      }
    }

    if (recipientLookupStrategy != null) {
      filterContext.setAttributeRecipientID(recipientLookupStrategy.apply(profileRequestContext));
    } else {
      filterContext.setAttributeRecipientID(null);
    }

    if (issuerLookupStrategy != null) {
      filterContext.setAttributeIssuerID(issuerLookupStrategy.apply(profileRequestContext));
    } else {
      filterContext.setAttributeIssuerID(null);
    }

    filterContext.setRequesterMetadataContextLookupStrategy(metadataFromFilterLookupStrategy);

    // If the filter context doesn't have a set of attributes to filter already
    // then look for them in the AttributeContext.
    if (filterContext.getPrefilteredIdPAttributes().isEmpty()) {
      filterContext.setPrefilteredIdPAttributes(attributeContext.getIdPAttributes().values());
    }
  }