### Question:
InMemorySLAProvider implements ServiceLevelAgreementProvider { @Override public ServiceLevelAgreementBuilder builder() { return new SLABuilderImpl(); } InMemorySLAProvider(); @Override ID resolve(Serializable ser); @Override List<ServiceLevelAgreement> getAgreements(); @Override ServiceLevelAgreement getAgreement(ID id); @Override ServiceLevelAgreement findAgreementByName(String slaName); @Override boolean removeAgreement(ID id); @Override ServiceLevelAgreementBuilder builder(); @Override ServiceLevelAgreementBuilder builder(ID id); @Override ServiceLevelAgreementCheckBuilder slaCheckBuilder(ID slaId);  }### Answer:
@Test(expected = DuplicateAgreementNameException.class) public void testCreateDuplicateName() { this.provider.builder().name("testCreateSLA").build(); this.provider.builder().name("testCreateSLA").build(); }
@Test(expected = DuplicateAgreementNameException.class) public void testReplaceDuplicateName() { ServiceLevelAgreement.ID id = this.provider.builder().name("Initial").build().getId(); this.provider.builder().name("Another").build(); this.provider.builder(id).name("Another").build(); }