int count = 0;
while (alternativeIterator.hasNext()) {
List<Assertion> alternative = alternativeIterator.next();
assertEquals(1, alternative.size());
assertTrue(alternative.get(0) instanceof Wss11);
Wss11 wss11 = (Wss11) alternative.get(0);
assertFalse(wss11.isNormalized());
assertTrue(wss11.isIgnorable());
assertTrue(wss11.isOptional());
assertEquals(Constants.TYPE_ASSERTION, wss11.getType());
assertEquals(SP12Constants.WSS11, wss11.getName());
assertTrue(wss11.isMustSupportRefEmbeddedToken());
assertTrue(wss11.isMustSupportRefExternalURI());
assertTrue(wss11.isMustSupportRefIssuerSerial());
assertTrue(wss11.isMustSupportRefKeyIdentifier());
assertTrue(wss11.isMustSupportRefEncryptedKey());
assertTrue(wss11.isMustSupportRefThumbprint());
assertTrue(wss11.isRequireSignatureConfirmation());
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();
Wss11 wss11 = (Wss11) policyComponentIterator.next();
assertTrue(wss11.isNormalized());
assertTrue(wss11.isIgnorable());
assertFalse(wss11.isOptional());
assertEquals(Constants.TYPE_ASSERTION, wss11.getType());
assertEquals(SP12Constants.WSS11, wss11.getName());
assertTrue(wss11.isMustSupportRefEmbeddedToken());
assertTrue(wss11.isMustSupportRefExternalURI());
assertTrue(wss11.isMustSupportRefIssuerSerial());
assertTrue(wss11.isMustSupportRefKeyIdentifier());
assertTrue(wss11.isMustSupportRefEncryptedKey());
assertTrue(wss11.isMustSupportRefThumbprint());
assertTrue(wss11.isRequireSignatureConfirmation());
}