### 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
import org.elasticsearch.action.support.PlainActionFuture;
import org.elasticsearch.cluster.metadata.IndexAbstraction;
import org.elasticsearch.cluster.metadata.IndexAbstraction.ConcreteIndex;
import org.elasticsearch.cluster.metadata.IndexMetadata;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.transport.TransportRequest;
import org.elasticsearch.xpack.core.security.authc.Authentication;
import org.elasticsearch.xpack.core.security.authc.Authentication.RealmRef;
import org.elasticsearch.xpack.core.security.authz.AuthorizationEngine.AuthorizationInfo;
import org.elasticsearch.xpack.core.security.authz.AuthorizationEngine.AuthorizationResult;
import org.elasticsearch.xpack.core.security.authz.AuthorizationEngine.IndexAuthorizationResult;
import org.elasticsearch.xpack.core.security.authz.AuthorizationEngine.RequestInfo;
import org.elasticsearch.xpack.core.security.authz.ResolvedIndices;
import org.elasticsearch.xpack.core.security.authz.accesscontrol.IndicesAccessControl;
import org.elasticsearch.xpack.core.security.user.User;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import static org.hamcrest.Matchers.is;
/**
 * Unit tests for the custom authorization engine. These are basic tests that validate the
 * engine's functionality outside of being used by the AuthorizationService
 */
public class CustomAuthorizationEngineTests extends ESTestCase {
    public void testGetAuthorizationInfo() {
        PlainActionFuture<AuthorizationInfo> future = new PlainActionFuture<>();
        CustomAuthorizationEngine engine = new CustomAuthorizationEngine();
        engine.resolveAuthorizationInfo(getRequestInfo(), future);
        assertNotNull(future.actionGet());