Entity bareJID = entity.getBareJID();
if (getAffiliation(nodeName, bareJID).equals(PubSubAffiliation.OWNER)
&& !affiliation.equals(PubSubAffiliation.OWNER)
&& countAffiliations(nodeName, PubSubAffiliation.OWNER) == 1) {
throw new LastOwnerResignedException(bareJID.getFullQualifiedName() + " tried to resign from " + nodeName);
}
if (affiliation.equals(PubSubAffiliation.NONE)) {
affils.remove(bareJID); // NONE affiliations are not stored.
} else {