AbstractFilter implements Filter { @Override public final void destroy() { initialized.forEach(Filter::destroy); try { doDestroy(); } catch (Exception error) { throw Throwables.propagate(error); } disabled = false; filterConfig = null; servletContext = null; initialized.clear(); LOGGER.debug("Destroyed [{}]", getClass().getName()); }  FilterConfig getFilterConfig(); ServletContext getServletContext(); @Override final void init(FilterConfig config); @Override final void destroy(); @Override final void doFilter(
            ServletRequest request,
            ServletResponse response,
            FilterChain chain); static final String DISABLE_FILTER_SETTING_PREFIX; }
@Test public void destroy() throws Exception { AbstractFilter filter = initFilter(createNoOverridesFilter()); filter.destroy(); assertThat(filter.getFilterConfig(), nullValue()); assertThat(filter.getServletContext(), nullValue()); }
@Test(expected = RuntimeException.class) public void doDestroyException() throws Exception { AbstractFilter filter = initFilter(new AbstractFilter() { @Override protected void doDestroy() throws Exception { throw new Exception(); } }); filter.destroy(); }