assertTrue("expected non-null subject", subject != null);
assertEquals("Principals", 0, subject.getPrincipals().size());
assertEquals("Private credentials", 1, subject.getPrivateCredentials().size());
assertEquals("NamedUsernamePasswordCredential private credentials", 1, subject.getPrivateCredentials(NamedUsernamePasswordCredential.class).size());
assertEquals("Public credentials", 0, subject.getPublicCredentials().size());
NamedUsernamePasswordCredential namedupc = (NamedUsernamePasswordCredential) subject.getPrivateCredentials().toArray()[0];
assertEquals("Credential name", "cred1", namedupc.getName());
assertEquals("Username", "name1", namedupc.getUsername());
assertEquals("Password", "pwd1", new String(namedupc.getPassword()));
context.logout();
assertEquals("Private credentials upon logout", 0, subject.getPrivateCredentials().size());
assertTrue("id of server subject should be null", ContextManager.getSubjectId(subject) == null);