class MinimalAuthenticationExpressionSupport {

        // -----------------------------------------------------------------------------------------------
        // This class is meant to given a minimal support to Spring Security expressions available at
        // the sec:authorize tags for Spring WebFlux applications, for which Spring Security (as of 5.1)
        // does not provide full support for expression execution.
        // -----------------------------------------------------------------------------------------------


        // Fixing the impl doesn't seem completely right, but actually it's what is currently being done at
        // Spring Security's "DefaultWebSecurityExpressionHandler" (as of Spring Security 5.1)
        private static final AuthenticationTrustResolver trustResolver = new AuthenticationTrustResolverImpl();


        // We will define "minimal support" as only supporting these specific expressions, which only
        // require involvement of the trust resolver.
        private static final String EXPR_ISAUTHENTICATED = "isAuthenticated()";
        private static final String EXPR_ISFULLYAUTHENTICATED = "isFullyAuthenticated()";
        private static final String EXPR_ISANONYMOUS = "isAnonymous()";
        private static final String EXPR_ISREMEMBERME = "isRememberMe()";
        private static final Set<String> HANDLED_EXPRESSIONS =
                new LinkedHashSet<String>(Arrays.asList(new String[] {
                    EXPR_ISAUTHENTICATED, EXPR_ISFULLYAUTHENTICATED, EXPR_ISANONYMOUS, EXPR_ISREMEMBERME
                }));

        static boolean isMinimalHandledExpression(final String accessExpression) {
            return HANDLED_EXPRESSIONS.contains(accessExpression);
        }


        static boolean evaluateMinimalExpression(final String accessExpression, final Authentication authentication) {<FILL_FUNCTION_BODY>}

        private static boolean isAnonymous(final Authentication authentication) {
            return trustResolver.isAnonymous(authentication);
        }

        private static boolean isAuthenticated(final Authentication authentication) {
            return !isAnonymous(authentication);
        }

        private static boolean isRememberMe(final Authentication authentication) {
            return trustResolver.isRememberMe(authentication);
        }

        private static boolean isFullyAuthenticated(final Authentication authentication) {
            return !trustResolver.isAnonymous(authentication)
                    && !trustResolver.isRememberMe(authentication);
        }


    }

            if (EXPR_ISAUTHENTICATED.equals(accessExpression)) {
                return isAuthenticated(authentication);
            }
            if (EXPR_ISFULLYAUTHENTICATED.equals(accessExpression)) {
                return isFullyAuthenticated(authentication);
            }
            if (EXPR_ISANONYMOUS.equals(accessExpression)) {
                return isAnonymous(authentication);
            }
            if (EXPR_ISREMEMBERME.equals(accessExpression)) {
                return isRememberMe(authentication);
            }
            throw new IllegalArgumentException(
                    "Unknown minimal expression: \"" + accessExpression + "\". Supported expressions are: " +
                    HANDLED_EXPRESSIONS);
        
<no_super_class>