@Test
public void testIsAnonymousAccount() {

    Subject subject = new SubjectAdapter() {
        @Override
        public PrincipalCollection getPrincipals() {
            return new SimplePrincipalCollection("anonymous", "iniRealm");
        }
    };
    assertTrue(policy.isAnonymousAccount(subject));
}