### CI Link

https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+pull-request+example-plugins/930/console

### Repro line

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

### Does it reproduce?

Yes

### Applicable branches

master

### Failure history

_No response_

### Failure excerpt

The example projects fails with a compile error caused by this change here: https://github.com/elastic/elasticsearch/pull/86206

This is blocking current PR checks as example pr build is failing.

the stack trace:
> Task :security-authorization-engine:compileTestJava FAILED
09:14:22 /dev/shm/elastic+elasticsearch+pull-request+example-plugins/plugins/examples/security-authorization-engine/src/test/java/org/elasticsearch/example/CustomAuthorizationEngineTests.java:56: error: no suitable constructor found for Authentication(User,RealmRef,RealmRef)
09:14:22                 new Authentication(new User("joe", new String[]{"custom_superuser"}, new User("bar", "not_superuser")),
09:14:22                 ^
09:14:22     constructor Authentication.Authentication(User,RealmRef,RealmRef,Version,AuthenticationType,Map<String,Object>) is not applicable
09:14:22       (actual and formal argument lists differ in length)
09:14:22     constructor Authentication.Authentication(StreamInput) is not applicable
09:14:22       (actual and formal argument lists differ in length)
09:14:22 /dev/shm/elastic+elasticsearch+pull-request+example-plugins/plugins/examples/security-authorization-engine/src/test/java/org/elasticsearch/example/CustomAuthorizationEngineTests.java:73: error: no suitable constructor found for Authentication(User,RealmRef,RealmRef)
09:14:22                 new Authentication(new User("joe", new String[]{"not_superuser"}, new User("bar", "custom_superuser")),
09:14:22     
plugins/examples/security-authorization-engine/src/test/java/org/elasticsearch/example/CustomAuthorizationEngineTests.java
AuthorizationResult result = resultFuture.actionGet();
            assertThat(result.isGranted(), is(false));
            assertThat(result.isAuditable(), is(true));
        }
    }
    public void testAuthorizeIndexAction() {
        CustomAuthorizationEngine engine = new CustomAuthorizationEngine();
        Map<String, IndexAbstraction> indicesMap = new HashMap<>();
        indicesMap.put("index", new ConcreteIndex(IndexMetadata.builder("index")
            .settings(Settings.builder().put("index.version.created", Version.CURRENT))
            .numberOfShards(1)
            .numberOfReplicas(0)
            .build(), null));
        
        {
            RequestInfo requestInfo =
                new RequestInfo(new Authentication(new User("joe", "custom_superuser"), new RealmRef("test", "test", "node"), null),
                    new SearchRequest(), "indices:data/read/search", null);
            PlainActionFuture<AuthorizationInfo> future = new PlainActionFuture<>();
            engine.resolveAuthorizationInfo(requestInfo, future);
            AuthorizationInfo authzInfo = future.actionGet();
            PlainActionFuture<IndexAuthorizationResult> resultFuture = new PlainActionFuture<>();
            engine.authorizeIndexAction(requestInfo, authzInfo,
                listener -> listener.onResponse(new ResolvedIndices(Collections.singletonList("index"), Collections.emptyList())),
                indicesMap, resultFuture);
            IndexAuthorizationResult result = resultFuture.actionGet();
            assertThat(result.isGranted(), is(true));
            assertThat(result.isAuditable(), is(true));
            IndicesAccessControl indicesAccessControl = result.getIndicesAccessControl();
            assertNotNull(indicesAccessControl.getIndexPermissions("index"));