class AzureAdIdTokenValidator extends IDTokenValidator {
    private IDTokenValidator base;
    private String originalIssuer;

    /**
     * <p>Constructor for AzureAdIdTokenValidator.</p>
     *
     * @param base a {@link IDTokenValidator} object
     */
    public AzureAdIdTokenValidator(final IDTokenValidator base) {
        super(base.getExpectedIssuer(), base.getClientID());
        this.base = base;
        this.originalIssuer = base.getExpectedIssuer().getValue();
    }

    /** {@inheritDoc} */
    @Override
    public IDTokenClaimsSet validate(final JWT idToken, final Nonce expectedNonce) throws BadJOSEException, JOSEException {<FILL_FUNCTION_BODY>}
}

        try {
            if (originalIssuer.contains("%7Btenantid%7D")) {
                var tid = idToken.getJWTClaimsSet().getClaim("tid");
                if (tid == null) {
                    throw new BadJWTException("ID token does not contain the 'tid' claim");
                }
                base = new IDTokenValidator(new Issuer(originalIssuer.replace("%7Btenantid%7D", tid.toString())),
                        base.getClientID(), base.getJWSKeySelector(), base.getJWEKeySelector());
                base.setMaxClockSkew(getMaxClockSkew());
            }
        } catch (ParseException e) {
            throw new BadJWTException(e.getMessage(), e);
        }
        return base.validate(idToken, expectedNonce);
    
<methods>public void <init>(com.nimbusds.oauth2.sdk.id.Issuer, com.nimbusds.oauth2.sdk.id.ClientID) ,public void <init>(com.nimbusds.oauth2.sdk.id.Issuer, com.nimbusds.oauth2.sdk.id.ClientID, com.nimbusds.jose.JWSAlgorithm, com.nimbusds.jose.jwk.JWKSet) ,public void <init>(com.nimbusds.oauth2.sdk.id.Issuer, com.nimbusds.oauth2.sdk.id.ClientID, com.nimbusds.jose.JWSAlgorithm, java.net.URL) ,public void <init>(com.nimbusds.oauth2.sdk.id.Issuer, com.nimbusds.oauth2.sdk.id.ClientID, com.nimbusds.jose.JWSAlgorithm, com.nimbusds.oauth2.sdk.auth.Secret) ,public void <init>(com.nimbusds.oauth2.sdk.id.Issuer, com.nimbusds.oauth2.sdk.id.ClientID, JWSKeySelector#RAW, JWEKeySelector#RAW) ,public void <init>(com.nimbusds.oauth2.sdk.id.Issuer, com.nimbusds.oauth2.sdk.id.ClientID, com.nimbusds.jose.JWSAlgorithm, java.net.URL, com.nimbusds.jose.util.ResourceRetriever) ,public void <init>(com.nimbusds.jose.JOSEObjectType, com.nimbusds.oauth2.sdk.id.Issuer, com.nimbusds.oauth2.sdk.id.ClientID, JWSKeySelector#RAW, JWEKeySelector#RAW) ,public static com.nimbusds.openid.connect.sdk.validators.IDTokenValidator create(com.nimbusds.openid.connect.sdk.op.OIDCProviderMetadata, com.nimbusds.openid.connect.sdk.rp.OIDCClientInformation) throws com.nimbusds.oauth2.sdk.GeneralException,public static com.nimbusds.openid.connect.sdk.validators.IDTokenValidator create(com.nimbusds.oauth2.sdk.id.Issuer, com.nimbusds.openid.connect.sdk.rp.OIDCClientInformation) throws com.nimbusds.oauth2.sdk.GeneralException, java.io.IOException,public static com.nimbusds.openid.connect.sdk.validators.IDTokenValidator create(com.nimbusds.openid.connect.sdk.op.OIDCProviderMetadata, com.nimbusds.openid.connect.sdk.rp.OIDCClientInformation, JWKSource#RAW) throws com.nimbusds.oauth2.sdk.GeneralException,public static com.nimbusds.openid.connect.sdk.validators.IDTokenValidator create(com.nimbusds.oauth2.sdk.id.Issuer, com.nimbusds.openid.connect.sdk.rp.OIDCClientInformation, JWKSource#RAW, int, int) throws com.nimbusds.oauth2.sdk.GeneralException, java.io.IOException,public com.nimbusds.openid.connect.sdk.claims.IDTokenClaimsSet validate(com.nimbusds.jwt.JWT, com.nimbusds.openid.connect.sdk.Nonce) throws com.nimbusds.jose.proc.BadJOSEException, com.nimbusds.jose.JOSEException<variables>