@Test
public void testIsAuthenticationRequiredWhenSystemConnectionAndSystemSubject() {

    Subject subject = new SubjectAdapter() {
        @Override
        public PrincipalCollection getPrincipals() {
            return new SimplePrincipalCollection("system", "iniRealm");
        }
    };
    SubjectConnectionReference sc = new SubjectConnectionReference(new ConnectionContext(), new ConnectionInfo(),
            new DefaultEnvironment(), subject);
    assertFalse(policy.isAuthenticationRequired(sc));
}