ServletContextAdapter implements ServletContext { public Servlet getServlet(String string) throws ServletException { return rootContext.getServlet(string); } @SuppressWarnings("unchecked")  ServletContextAdapter(ServletConfig config); ServletContext getContext(String string); int getMajorVersion(); int getMinorVersion(); String getMimeType(String string); @SuppressWarnings({ "rawtypes" }) Set getResourcePaths(String string); URL getResource(String string); InputStream getResourceAsStream(String string); RequestDispatcher getRequestDispatcher(String string); RequestDispatcher getNamedDispatcher(String string); Servlet getServlet(String string); @SuppressWarnings("rawtypes") Enumeration getServlets(); @SuppressWarnings("rawtypes") Enumeration getServletNames(); void log(String string); void log(Exception exception, String string); void log(String string, Throwable throwable); String getRealPath(String string); String getServerInfo(); String getInitParameter(String string); @SuppressWarnings("rawtypes") Enumeration getInitParameterNames(); Object getAttribute(String string); @SuppressWarnings("rawtypes") Enumeration getAttributeNames(); void setAttribute(String string, Object object); void removeAttribute(String string); String getServletContextName(); String getContextPath();  }
@SuppressWarnings("deprecation") @Test public void testGetServlet() throws ServletException { Servlet is = createMock(Servlet.class); expect(servletContext.getServlet("whatever")).andReturn(is); replay(servletContext, config, is); ServletContextAdapter adapter = new ServletContextAdapter(config); assertEquals(is, adapter.getServlet("whatever")); verify(is); }