### Question:
DefaultConnectionSubjectFactory implements ConnectionSubjectFactory { public void setAuthenticationPolicy(AuthenticationPolicy authenticationPolicy) { this.authenticationPolicy = authenticationPolicy; } DefaultConnectionSubjectFactory(); AuthenticationPolicy getAuthenticationPolicy(); void setAuthenticationPolicy(AuthenticationPolicy authenticationPolicy); @Override Subject createSubject(ConnectionReference conn);  }### Answer:
@Test public void testSetAuthenticationPolicy() { AuthenticationPolicy policy = new AuthenticationPolicy() { @Override public void customizeSubject(Subject.Builder subjectBuilder, ConnectionReference ref) { } @Override public boolean isAuthenticationRequired(SubjectConnectionReference ref) { return false; } }; factory.setAuthenticationPolicy(policy); assertSame(policy, factory.getAuthenticationPolicy()); }