// Path: dagger-servlet/src/main/java/com/leacox/dagger/servlet/ServletScopes.java
// enum NullObject {
//     INSTANCE
// }


import dagger.Module;
import dagger.ObjectGraph;
import dagger.Provides;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import javax.inject.Singleton;
import javax.servlet.FilterChain;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import static com.leacox.dagger.servlet.ServletScopes.NullObject;
import static org.easymock.EasyMock.createMock;
import static org.easymock.EasyMock.createNiceMock;
import static org.easymock.EasyMock.eq;
import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.expectLastCall;
import static org.easymock.EasyMock.isA;
import static org.easymock.EasyMock.replay;
import static org.easymock.EasyMock.verify;
import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertNull;
import static org.testng.Assert.assertSame;
import static org.testng.Assert.assertTrue;

            @Override
            protected Class<?>[] getRequestScopedModules() {
                return new Class<?>[]{TestRequestModule.class};
            }

            @Override
            protected void configureServlets() {
            }
        };

        ServletContext servletContext = createMock(ServletContext.class);
        contextListener.contextInitialized(new ServletContextEvent(servletContext));
        final ObjectGraph objectGraph = contextListener.getObjectGraph();

        DaggerFilter filter = new DaggerFilter();

        final HttpServletRequest request = createMock(HttpServletRequest.class);

        String inRequestKey = IN_REQUEST_KEY.toString();
        expect(request.getAttribute(inRequestKey)).andReturn(null);
        request.setAttribute(eq(inRequestKey), isA(InRequest.class));

        String objectGraphKey = OBJECT_GRAPH_KEY.toString();
        expect(request.getAttribute(objectGraphKey)).andReturn(null);
        request.setAttribute(eq(objectGraphKey), isA(ObjectGraph.class));
        expectLastCall();

        String inRequestNullKey = IN_REQUEST_NULLABLE_KEY.toString();
        expect(request.getAttribute(inRequestNullKey)).andReturn(null);
// Path: dagger-servlet/src/main/java/com/leacox/dagger/servlet/ServletScopes.java
// enum NullObject {
//     INSTANCE
// }


// Path: dagger-servlet/src/test/java/com/leacox/dagger/servlet/ServletTest.java
import dagger.Module;
import dagger.ObjectGraph;
import dagger.Provides;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import javax.inject.Singleton;
import javax.servlet.FilterChain;
import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import static com.leacox.dagger.servlet.ServletScopes.NullObject;
import static org.easymock.EasyMock.createMock;
import static org.easymock.EasyMock.createNiceMock;
import static org.easymock.EasyMock.eq;
import static org.easymock.EasyMock.expect;
import static org.easymock.EasyMock.expectLastCall;
import static org.easymock.EasyMock.isA;
import static org.easymock.EasyMock.replay;
import static org.easymock.EasyMock.verify;
import static org.testng.Assert.assertNotNull;
import static org.testng.Assert.assertNull;
import static org.testng.Assert.assertSame;
import static org.testng.Assert.assertTrue;


            @Override
            protected Class<?>[] getRequestScopedModules() {
                return new Class<?>[]{TestRequestModule.class};
            }

            @Override
            protected void configureServlets() {
            }
        };

        ServletContext servletContext = createMock(ServletContext.class);
        contextListener.contextInitialized(new ServletContextEvent(servletContext));
        final ObjectGraph objectGraph = contextListener.getObjectGraph();

        DaggerFilter filter = new DaggerFilter();

        final HttpServletRequest request = createMock(HttpServletRequest.class);

        String inRequestKey = IN_REQUEST_KEY.toString();
        expect(request.getAttribute(inRequestKey)).andReturn(null);
        request.setAttribute(eq(inRequestKey), isA(InRequest.class));

        String objectGraphKey = OBJECT_GRAPH_KEY.toString();
        expect(request.getAttribute(objectGraphKey)).andReturn(null);
        request.setAttribute(eq(objectGraphKey), isA(ObjectGraph.class));
        expectLastCall();

        String inRequestNullKey = IN_REQUEST_NULLABLE_KEY.toString();
        expect(request.getAttribute(inRequestNullKey)).andReturn(null);
        request.setAttribute(eq(inRequestNullKey), eq(NullObject.INSTANCE));