int count = 0;
while (alternativeIterator.hasNext()) {
List<Assertion> alternative = alternativeIterator.next();
assertEquals(1, alternative.size());
assertTrue(alternative.get(0) instanceof Trust13);
Trust13 trust13 = (Trust13) alternative.get(0);
assertFalse(trust13.isNormalized());
assertTrue(trust13.isIgnorable());
assertTrue(trust13.isOptional());
assertEquals(Constants.TYPE_ASSERTION, trust13.getType());
assertEquals(SP13Constants.TRUST_13, trust13.getName());
assertTrue(trust13.isMustSupportClientChallenge());
assertTrue(trust13.isMustSupportServerChallenge());
assertTrue(trust13.isRequireClientEntropy());
assertTrue(trust13.isRequireServerEntropy());
assertTrue(trust13.isMustSupportIssuedTokens());
assertTrue(trust13.isRequireRequestSecurityTokenCollection());
assertTrue(trust13.isRequireAppliesTo());
assertTrue(trust13.isScopePolicy15());
assertTrue(trust13.isMustSupportInteractiveChallenge());
count++;
}
assertEquals(1, count);
policy = policy.normalize(true);
serializedPolicy = serializePolicy(policy);
assertXMLisEqual(serializedPolicy, normalizedPolicyReferenceFile);
alternativeIterator = policy.getAlternatives();
List<Assertion> alternative = alternativeIterator.next();
assertEquals(0, alternative.size());
List<PolicyComponent> policyComponents = policy.getPolicyComponents();
assertEquals(1, policyComponents.size());
PolicyOperator policyOperator = (PolicyOperator) policyComponents.get(0);
policyComponents = policyOperator.getPolicyComponents();
assertEquals(2, policyComponents.size());
All all = (All) policyComponents.get(0);
List<PolicyComponent> policyComponentsAll = all.getAssertions();
assertEquals(0, policyComponentsAll.size());
all = (All) policyComponents.get(1);
policyComponentsAll = all.getAssertions();
assertEquals(1, policyComponentsAll.size());
Iterator<PolicyComponent> policyComponentIterator = policyComponentsAll.iterator();
Trust13 trust13 = (Trust13) policyComponentIterator.next();
assertTrue(trust13.isNormalized());
assertTrue(trust13.isIgnorable());
assertFalse(trust13.isOptional());
assertEquals(Constants.TYPE_ASSERTION, trust13.getType());
assertEquals(SP13Constants.TRUST_13, trust13.getName());
assertTrue(trust13.isMustSupportClientChallenge());
assertTrue(trust13.isMustSupportServerChallenge());
assertTrue(trust13.isRequireClientEntropy());
assertTrue(trust13.isRequireServerEntropy());
assertTrue(trust13.isMustSupportIssuedTokens());
assertTrue(trust13.isRequireRequestSecurityTokenCollection());
assertTrue(trust13.isRequireAppliesTo());
assertTrue(trust13.isScopePolicy15());
assertTrue(trust13.isMustSupportInteractiveChallenge());
}