### Question:
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, SAMLMessageStorage messageStore); SAMLMessageContext getCredentials(); SAMLMessageStorage getMessageStore(); Object getPrincipal(); void setAuthenticated(boolean isAuthenticated);  }### Answer:
@Test(expected = IllegalArgumentException.class) public void testSetAuthenticated() { token.setAuthenticated(true); }