SAMLAuthenticationToken extends AbstractAuthenticationToken { public void setAuthenticated(boolean isAuthenticated) throws IllegalArgumentException { if (isAuthenticated) { throw new IllegalArgumentException( "Cannot set this token to trusted - use constructor containing GrantedAuthority[]s instead"); } super.setAuthenticated(false); } SAMLAuthenticationToken(SAMLMessageContext credentials); SAMLMessageContext getCredentials(); Object getPrincipal(); void setAuthenticated(boolean isAuthenticated);  }
@Test(expected = IllegalArgumentException.class) public void testSetAuthenticated() { token.setAuthenticated(true); }