public static Set getClaims(SAMLAssertion assertion){
Set claims = new TreeSet();
Iterator statements = assertion.getStatements();
// iterate over the statements
while(statements.hasNext()){
SAMLStatement statement = (SAMLStatement) statements.next();
// if it is AttributeStatement, then extract the attributes
if(statement instanceof SAMLAttributeStatement){
Iterator attributes = ((SAMLAttributeStatement)statement).getAttributes();
while(attributes.hasNext()){
SAMLAttribute attribute = (SAMLAttribute)attributes.next();