PseudoAuthenticationHandler implements AuthenticationHandler { @Override public void init(Properties config) throws ServletException { acceptAnonymous = Boolean.parseBoolean(config.getProperty(ANONYMOUS_ALLOWED, "false")); } PseudoAuthenticationHandler();  PseudoAuthenticationHandler(String type); @Override void init(Properties config); @Override void destroy(); @Override String getType(); @Override boolean managementOperation(AuthenticationToken token,
                                     HttpServletRequest request,
                                     HttpServletResponse response); @Override AuthenticationToken authenticate(HttpServletRequest request, HttpServletResponse response); static final String TYPE; static final String ANONYMOUS_ALLOWED; }
@Test public void testInit() throws Exception { PseudoAuthenticationHandler handler = new PseudoAuthenticationHandler(); try { Properties props = new Properties(); props.setProperty(PseudoAuthenticationHandler.ANONYMOUS_ALLOWED, "false"); handler.init(props); Assert.assertEquals(false, handler.getAcceptAnonymous()); } finally { handler.destroy(); } }