assertTrue("subject should have one remote principal", subject.getPrincipals(IdentificationPrincipal.class).size() == 1);
IdentificationPrincipal remote = (IdentificationPrincipal) subject.getPrincipals(IdentificationPrincipal.class).iterator().next();
assertTrue("subject should be associated with remote id", ContextManager.getRegisteredSubject(remote.getId()) != null);
assertTrue("subject should have five principals", subject.getPrincipals().size() == 5);
assertTrue("subject should have two realm principal", subject.getPrincipals(RealmPrincipal.class).size() == 2);
RealmPrincipal principal = (RealmPrincipal) subject.getPrincipals(RealmPrincipal.class).iterator().next();
assertTrue("id of principal should be non-zero", principal.getId() != 0);
context.logout();
assertTrue("id of subject should be null", ContextManager.getSubjectId(subject) == null);
}