### Question:
SpnegoAuthenticationProcessingFilter extends GenericFilterBean { public void setSkipIfAlreadyAuthenticated(boolean skipIfAlreadyAuthenticated) { this.skipIfAlreadyAuthenticated = skipIfAlreadyAuthenticated; }  void doFilter(ServletRequest req, ServletResponse res, FilterChain chain); void setAuthenticationManager(AuthenticationManager authenticationManager); void setSuccessHandler(AuthenticationSuccessHandler successHandler); void setFailureHandler(AuthenticationFailureHandler failureHandler); void setSkipIfAlreadyAuthenticated(boolean skipIfAlreadyAuthenticated); @Override void afterPropertiesSet();  }### Answer:
@Test public void testAlreadyAuthenticatedNotActive() throws Exception { try { Authentication existingAuth = new UsernamePasswordAuthenticationToken("mike", "mike", AuthorityUtils.createAuthorityList("ROLE_TEST")); SecurityContextHolder.getContext().setAuthentication(existingAuth); filter.setSkipIfAlreadyAuthenticated(false); everythingWorks(); } finally { SecurityContextHolder.clearContext(); } }