### Question:
ModelFactoryMap implements Iterable<ModelTreeEntry> { public void assertContainsRequiredModel(String modelId) { String errorMessage = "No model factory found for dependent model id."; assertContainsModel(modelId, errorMessage); } ModelFactoryMap(ModelFactoryCollector collector); HeroModelFactory get(String configuredId); void assertContainsRequiredModel(String modelId); @Override Iterator<ModelTreeEntry> iterator();  }### Answer:
@Test public void hasRegisteredModel() throws Exception { map.assertContainsRequiredModel("A"); }
@Test(expected = IllegalStateException.class) public void throwsExceptionWhenUnknownModelIsAssertedAsRequired() throws Exception { map.assertContainsRequiredModel("Unknown"); }