### Question:
IdentityResolverFactory { public void setIdentityResolver(IdentityResolver identityResolver) { if (this.identityResolver != null && identityResolver != null) { throw new CougarFrameworkException("IdentityResolver is immutable!"); } this.identityResolver = identityResolver; }  IdentityResolver getIdentityResolver(); void setIdentityResolver(IdentityResolver identityResolver);  }### Answer:
@Test(expected = CougarFrameworkException.class) public void testDoubleRegistration() { IdentityResolverFactory factory = new IdentityResolverFactory(); factory.setIdentityResolver(new TestIdentityResolver()); factory.setIdentityResolver(new TestIdentityResolver()); }