### Question:
AuthenticationServletFilter extends InjectedFilter { public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { if (!(request instanceof HttpServletRequest && response instanceof HttpServletResponse)) { throw new ServletException("Auth filter can only handle HTTP"); } HttpServletRequest req = (HttpServletRequest) request; HttpServletResponse resp = (HttpServletResponse) response; String authHeader = null; try { for (AuthenticationHandler handler : handlers) { authHeader = handler.getWWWAuthenticateHeader(getRealm(req)); SecurityToken token = handler.getSecurityTokenFromRequest(req); if (token != null) { AuthInfoUtil.setAuthTypeForRequest(req, handler.getName()); AuthInfoUtil.setSecurityTokenForRequest(req, token); callChain(chain, req, resp); return; } else { setAuthHeader(authHeader, resp); } } callChain(chain, req, resp); } catch (AuthenticationHandler.InvalidAuthenticationException iae) { Throwable cause = iae.getCause(); if (LOG.isLoggable(Level.INFO)) { LOG.logp(Level.INFO, CLASSNAME, "doFilter", MessageKeys.ERROR_PARSING_SECURE_TOKEN, cause); } if (iae.getAdditionalHeaders() != null) { for (Map.Entry<String,String> entry : iae.getAdditionalHeaders().entrySet()) { resp.addHeader(entry.getKey(), entry.getValue()); } } if (iae.getRedirect() != null) { onRedirect(req, resp, iae); } else { setAuthHeader(authHeader, resp); onError(req, resp, iae); } } }  @Inject(optional = true) void setAuthenticationRealm(@Named("shindig.authentication.realm") String realm); @Inject void setAuthenticationHandlers(List<AuthenticationHandler> handlers); void destroy(); void doFilter(ServletRequest request, ServletResponse response, FilterChain chain); static final String WWW_AUTHENTICATE_HEADER; }### Answer:
@Test(expected = ServletException.class) public void testDoFilter_BadArgs() throws Exception { filter.doFilter(null, null, null); }