### Question:
AuthCheckFilter implements Filter { public static boolean isServletRequestAuthenticatorInstanceOf(Class<? extends ServletRequestAuthenticator> clazz) { final AuthCheckFilter instance = getInstance(); if (instance == null) { return false; } return servletRequestAuthenticator != null && clazz.isAssignableFrom(servletRequestAuthenticator.getClass()); } AuthCheckFilter();   AuthCheckFilter(final AdminManager adminManager, final LoginLimitManager loginLimitManager); static AuthCheckFilter getInstance(); static boolean isServletRequestAuthenticatorInstanceOf(Class<? extends ServletRequestAuthenticator> clazz); static void addExclude(String exclude); static void removeExclude(String exclude); static boolean testURLPassesExclude(String url, String exclude); @Override void init(FilterConfig config); @Override void doFilter(ServletRequest req, ServletResponse res, FilterChain chain); @Override void destroy(); static final SystemProperty<Class> SERVLET_REQUEST_AUTHENTICATOR; }### Answer:
@Test public void willReturnTrueIfTheCorrectServletRequestAuthenticatorIsConfigured() { new AuthCheckFilter(adminManager, loginLimitManager); AuthCheckFilter.SERVLET_REQUEST_AUTHENTICATOR.setValue(NormalUserServletAuthenticatorClass.class); assertThat(AuthCheckFilter.isServletRequestAuthenticatorInstanceOf(NormalUserServletAuthenticatorClass.class), is(true)); }
@Test public void willReturnFalseIfTheWrongServletRequestAuthenticatorIsConfigured() { AuthCheckFilter.SERVLET_REQUEST_AUTHENTICATOR.setValue(NormalUserServletAuthenticatorClass.class); new AuthCheckFilter(adminManager, loginLimitManager); assertThat(AuthCheckFilter.isServletRequestAuthenticatorInstanceOf(AdminUserServletAuthenticatorClass.class), is(false)); }
@Test public void willReturnFalseIfNoServletRequestAuthenticatorIsConfigured() { new AuthCheckFilter(adminManager, loginLimitManager); assertThat(AuthCheckFilter.isServletRequestAuthenticatorInstanceOf(AdminUserServletAuthenticatorClass.class), is(false)); }