class DefaultWebApplication implements WebApplication {

    @Override
    public void destroy() {
        verifyState(INITIALIZED, "Unable to destroy web application");

        servletEnvironments.values().stream().forEach(servletEnv -> servletEnv.getServlet().destroy());
        servletEnvironments.clear();


        reverse(contextListeners);
        contextListeners.stream().forEach(listener -> listener.contextDestroyed(new ServletContextEvent(this)));
        contextListeners.clear();

        reverse(declaredContextListeners);
        declaredContextListeners.stream().forEach(listener -> listener.contextDestroyed(new ServletContextEvent(this)));
        declaredContextListeners.clear();
        status = SETUP;
    }

    public  DefaultWebApplication();

}