### CI Link

https://gradle-enterprise.elastic.co/s/ozb6lycxc43es/console-log?task=:security-authorization-engine:compileJava

### Repro line

cd plugin/examples; ./gradlew build --include-build ../..

### Does it reproduce?

Yes

### Applicable branches

master

### Failure history

_No response_

### Failure excerpt

After merging https://github.com/elastic/elasticsearch/pull/86246 example builds started failing with compilation errors 

```
> Task :security-authorization-engine:compileJava FAILED
/Users/rene/dev/elasticsearch-master/plugins/examples/security-authorization-engine/src/main/java/org/elasticsearch/example/CustomAuthorizationEngine.java:50: error: cannot find symbol
        if (authentication.getUser().isRunAs()) {
                                    ^
  symbol:   method isRunAs()
  location: class User
/Users/rene/dev/elasticsearch-master/plugins/examples/security-authorization-engine/src/main/java/org/elasticsearch/example/CustomAuthorizationEngine.java:52: error: cannot find symbol
                new CustomAuthorizationInfo(authentication.getUser().authenticatedUser().roles(), null);
                                                                    ^
  symbol:   method authenticatedUser()
  location: class User
/Users/rene/dev/elasticsearch-master/plugins/examples/security-authorization-engine/src/main/java/org/elasticsearch/example/CustomAuthorizationEngine.java:61: error: cannot find symbol
        if (isSuperuser(requestInfo.getAuthentication().getUser().authenticatedUser())) {
                                                                 ^
  symbol:   method authenticatedUser()
  location: class User
Note: /Users/rene/dev/elasticsearch-master/plugins/examples/security-authorization-engine/src/main/java/org/elasticsearch/example/CustomAuthorizationEngine.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
3 errors

```
plugins/examples/security-authorization-engine/src/main/java/org/elasticsearch/example/CustomAuthorizationEngine.java
final Map<String, Boolean> privileges = new HashMap<>();
                        final ResourcePrivileges existing = appPrivilegesByResource.get(resource);
                        if (existing != null) {
                            privileges.putAll(existing.getPrivileges());
                        }
                        for (String privilege : p.getPrivileges()) {
                            privileges.put(privilege, authorized);
                        }
                        appPrivilegesByResource.put(resource, ResourcePrivileges.builder(resource).addPrivileges(privileges).build());
                    }
                }
            }
            privilegesByApplication.put(applicationName, appPrivilegesByResource.values());
        }
        return new HasPrivilegesResponse(authentication.getUser().principal(), authorized, clusterPrivMap, indices.values(),
            privilegesByApplication);
    }
    private GetUserPrivilegesResponse getUserPrivilegesResponse(boolean isSuperuser) {
        final Set<String> cluster = isSuperuser ? Collections.singleton("ALL") : Collections.emptySet();
        final Set<ConfigurableClusterPrivilege> conditionalCluster = Collections.emptySet();
        final Set<GetUserPrivilegesResponse.Indices> indices = isSuperuser ? Collections.singleton(new Indices(Collections.singleton("*"),
            Collections.singleton("*"), Collections.emptySet(), Collections.emptySet(), true)) : Collections.emptySet();
        final Set<RoleDescriptor.ApplicationResourcePrivileges> application = isSuperuser ?
            Collections.singleton(
                RoleDescriptor.ApplicationResourcePrivileges.builder().application("*").privileges("*").resources("*").build()) :
            Collections.emptySet();
        final Set<String> runAs = isSuperuser ? Collections.singleton("*") : Collections.emptySet();
        return new GetUserPrivilegesResponse(cluster, conditionalCluster, indices, application, runAs);
    }
    public static class CustomAuthorizationInfo implements AuthorizationInfo {