Subject subject = lc.getSubject();
System.out.println("Subject: "+subject);
Set groups = subject.getPrincipals(Group.class);
assertTrue("Principals contains jduke", subject.getPrincipals().contains(new SimplePrincipal("jduke")));
assertTrue("Principals contains Roles", groups.contains(new SimplePrincipal("Roles")));
Group roles = (Group) groups.iterator().next();
assertTrue("Echo is a role", roles.isMember(new SimplePrincipal("Echo")));
assertTrue("TheDuke is a role", roles.isMember(new SimplePrincipal("TheDuke")));
assertFalse("Echo2 is NOT a role", roles.isMember(new SimplePrincipal("Echo2")));
assertFalse("TheDuke2 is NOT a role", roles.isMember(new SimplePrincipal("TheDuke2")));
lc.logout();
}