### Question:
ChildAttributeResolverMappings { public ChildAttributeResolver resolverFor(String attribute) { if (childAttributeResolvers.containsKey(attribute)) { return childAttributeResolvers.get(attribute); } else { throw new RuntimeException("A ChildAttributeResolver for '" + attribute + "' is not specified"); } } ChildAttributeResolverMappings(); void map(ChildAttributeResolver resolver, String attribute); ChildAttributeResolver resolverFor(String attribute);  }### Answer:
@Test public void givenResolverForAttribute_whenAskResolverForAttribute_thenReturnExpectedResolver() { ChildAttributeResolver expectedResolver = givenResolverForAttribute(); ChildAttributeResolver actualResolver = mappings.resolverFor(ATTRIBUTE); assertThat(actualResolver, sameInstance(expectedResolver)); }
@Test(expected = RuntimeException.class) public void givenNoResolverForAttribute_whenAskResolverForAttribute_thenThrowException() { mappings.resolverFor(ATTRIBUTE); }