" <affiliation jid='polonius@denmark.lit' affiliation='outcast'/>\n" +
" </affiliations>\n" +
" </pubsub>\n" +
"</iq>";
IQ iq = unmarshal(xml, IQ.class);
PubSubOwner pubSubOwner = iq.getExtension(PubSubOwner.class);
Assert.assertNotNull(pubSubOwner);
Assert.assertNotNull(pubSubOwner.getAffiliations());
Assert.assertEquals(pubSubOwner.getNode(), "princely_musings");
Assert.assertEquals(pubSubOwner.getAffiliations().size(), 2);
Assert.assertEquals(pubSubOwner.getAffiliations().get(0).getJid(), Jid.valueOf("hamlet@denmark.lit"));
Assert.assertEquals(pubSubOwner.getAffiliations().get(0).getAffiliationState(), AffiliationState.OWNER);
Assert.assertEquals(pubSubOwner.getAffiliations().get(1).getJid(), Jid.valueOf("polonius@denmark.lit"));
Assert.assertEquals(pubSubOwner.getAffiliations().get(1).getAffiliationState(), AffiliationState.OUTCAST);
}