assertTrue("expected non-null subject", subject != null);
assertTrue("id of subject should be non-null", ContextManager.getSubjectId(subject) != null);
assertEquals("subject should have two principals", 2, subject.getPrincipals().size());
assertEquals("subject should have one realm principal", 1, subject.getPrincipals(RealmPrincipal.class).size());
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);
} catch (LoginException e) {