// Path: impl/src/main/java/org/jboss/arquillian/container/weld/embedded/literals/DestroyedLiteral.java
// @SuppressWarnings("all")
// public class DestroyedLiteral extends AnnotationLiteral<Destroyed> implements Destroyed {
// 
//     public static final DestroyedLiteral APPLICATION = new DestroyedLiteral(ApplicationScoped.class);
// 
//     private Class<? extends Annotation> value;
// 
//     private DestroyedLiteral(Class<? extends Annotation> value) {
//         this.value = value;
//     }
// 
//     @Override
//     public Class<? extends Annotation> value() {
//         return value;
//     }
// }
// 
// Path: impl/src/main/java/org/jboss/arquillian/container/weld/embedded/literals/InitializedLiteral.java
// @SuppressWarnings("all")
// public class InitializedLiteral extends AnnotationLiteral<Initialized> implements Initialized {
// 
//     public static final InitializedLiteral APPLICATION = new InitializedLiteral(ApplicationScoped.class);
// 
//     private Class<? extends Annotation> value;
// 
//     private InitializedLiteral(Class<? extends Annotation> value) {
//         this.value = value;
//     }
// 
//     @Override
//     public Class<? extends Annotation> value() {
//         return value;
//     }
// }


import java.net.URL;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import jakarta.enterprise.context.spi.Context;
import jakarta.enterprise.inject.Instance;
import org.jboss.weld.Container;
import org.jboss.weld.bootstrap.WeldBootstrap;
import org.jboss.weld.bootstrap.api.Bootstrap;
import org.jboss.weld.bootstrap.api.Environment;
import org.jboss.weld.bootstrap.api.Environments;
import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
import org.jboss.weld.bootstrap.spi.BeansXml;
import org.jboss.weld.bootstrap.spi.Deployment;
import org.jboss.weld.context.RequestContext;
import org.jboss.weld.context.bound.BoundSessionContext;
import org.jboss.weld.context.unbound.UnboundLiteral;
import org.jboss.weld.manager.api.WeldManager;
import static java.util.Arrays.asList;
import org.jboss.arquillian.container.weld.embedded.literals.DestroyedLiteral;
import org.jboss.arquillian.container.weld.embedded.literals.InitializedLiteral;
    public TestContainer ensureRequestActive() {
        RequestContext requestContext = instance().select(RequestContext.class, UnboundLiteral.INSTANCE).get();
        requestContext.activate();

        // TODO deactivate the conversation context

        BoundSessionContext sessionContext = instance().select(BoundSessionContext.class).get();
        sessionContext.associate(sessionStore);
        sessionContext.activate();
        return this;
    }

    public TestContainer startContainer() {
        return startContainer(Environments.SE);
    }

    /**
     * Starts the container and begins the application
     */
    public TestContainer startContainer(Environment environment) {
        this.sessionStore = new HashMap<String, Object>();
        this.environment = environment;
        bootstrap
                .startContainer(environment, deployment)
                .startInitialization()
                .deployBeans()
                .validateBeans()
                .endInitialization();
        if (environment.equals(Environments.SE)) {
            for (BeanDeploymentArchive beanDeploymentArchive : deployment.getBeanDeploymentArchives()) {
// Path: impl/src/main/java/org/jboss/arquillian/container/weld/embedded/literals/DestroyedLiteral.java
// @SuppressWarnings("all")
// public class DestroyedLiteral extends AnnotationLiteral<Destroyed> implements Destroyed {
// 
//     public static final DestroyedLiteral APPLICATION = new DestroyedLiteral(ApplicationScoped.class);
// 
//     private Class<? extends Annotation> value;
// 
//     private DestroyedLiteral(Class<? extends Annotation> value) {
//         this.value = value;
//     }
// 
//     @Override
//     public Class<? extends Annotation> value() {
//         return value;
//     }
// }
// 
// Path: impl/src/main/java/org/jboss/arquillian/container/weld/embedded/literals/InitializedLiteral.java
// @SuppressWarnings("all")
// public class InitializedLiteral extends AnnotationLiteral<Initialized> implements Initialized {
// 
//     public static final InitializedLiteral APPLICATION = new InitializedLiteral(ApplicationScoped.class);
// 
//     private Class<? extends Annotation> value;
// 
//     private InitializedLiteral(Class<? extends Annotation> value) {
//         this.value = value;
//     }
// 
//     @Override
//     public Class<? extends Annotation> value() {
//         return value;
//     }
// }


// Path: impl/src/main/java/org/jboss/arquillian/container/weld/embedded/mock/TestContainer.java
import java.net.URL;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import jakarta.enterprise.context.spi.Context;
import jakarta.enterprise.inject.Instance;
import org.jboss.weld.Container;
import org.jboss.weld.bootstrap.WeldBootstrap;
import org.jboss.weld.bootstrap.api.Bootstrap;
import org.jboss.weld.bootstrap.api.Environment;
import org.jboss.weld.bootstrap.api.Environments;
import org.jboss.weld.bootstrap.spi.BeanDeploymentArchive;
import org.jboss.weld.bootstrap.spi.BeansXml;
import org.jboss.weld.bootstrap.spi.Deployment;
import org.jboss.weld.context.RequestContext;
import org.jboss.weld.context.bound.BoundSessionContext;
import org.jboss.weld.context.unbound.UnboundLiteral;
import org.jboss.weld.manager.api.WeldManager;
import static java.util.Arrays.asList;
import org.jboss.arquillian.container.weld.embedded.literals.DestroyedLiteral;
import org.jboss.arquillian.container.weld.embedded.literals.InitializedLiteral;

    public TestContainer ensureRequestActive() {
        RequestContext requestContext = instance().select(RequestContext.class, UnboundLiteral.INSTANCE).get();
        requestContext.activate();

        // TODO deactivate the conversation context

        BoundSessionContext sessionContext = instance().select(BoundSessionContext.class).get();
        sessionContext.associate(sessionStore);
        sessionContext.activate();
        return this;
    }

    public TestContainer startContainer() {
        return startContainer(Environments.SE);
    }

    /**
     * Starts the container and begins the application
     */
    public TestContainer startContainer(Environment environment) {
        this.sessionStore = new HashMap<String, Object>();
        this.environment = environment;
        bootstrap
                .startContainer(environment, deployment)
                .startInitialization()
                .deployBeans()
                .validateBeans()
                .endInitialization();
        if (environment.equals(Environments.SE)) {
            for (BeanDeploymentArchive beanDeploymentArchive : deployment.getBeanDeploymentArchives()) {
                bootstrap.getManager(beanDeploymentArchive).getEvent().select(InitializedLiteral.APPLICATION).fire(new Object());