DefaultServletEnvironment implements ServletEnvironment { @Override public void setAsyncSupported(boolean asyncSupported) { this.asyncSupported = asyncSupported; } DefaultServletEnvironment(DefaultWebApplication webApp, String servletName);  DefaultServletEnvironment(DefaultWebApplication webApp, String servletName, Servlet servlet); @Override Set<String> addMapping(String... urlPatterns); @Override String getClassName(); @Override String getInitParameter(String name); @Override Enumeration<String> getInitParameterNames(); @Override Map<String, String> getInitParameters(); @Override int getLoadOnStartup(); @Override Collection<String> getMappings(); @Override MultipartConfigElement getMultipartConfig(); @Override String getName(); @Override String getRunAsRole(); @Override Servlet getServlet(); @Override ServletContext getServletContext(); @Override Class<? extends Servlet> getServletClass(); @Override String getServletName(); @Override int getStatus(); @Override WebApplication getWebApplication(); @Override boolean isAsyncSupported(); @Override void setAsyncSupported(boolean asyncSupported); @Override void setClassName(String className); @Override boolean setInitParameter(String name, String value); @Override Set<String> setInitParameters(Map<String, String> initParameters); @Override void setLoadOnStartup(int loadOnStartup); @Override void setMultipartConfig(MultipartConfigElement multipartConfig); @Override void setRunAsRole(String runAsRole); @Override void setServlet(Servlet servlet); @Override Set<String> setServletSecurity(ServletSecurityElement servletSecurityElement); @Override void setStatus(int status); @Override Throwable getUnavailableException(); @Override void setUnavailableException(Throwable unavailableException);  }
@Test void testSetAsyncSupported() { TestSnoopServlet servlet = new TestSnoopServlet(); DefaultServletEnvironment environment = new DefaultServletEnvironment(null, null, servlet); assertFalse(environment.isAsyncSupported()); environment.setAsyncSupported(true); assertTrue(environment.isAsyncSupported()); }