### Question:
PendingAttributesForViewImpl implements PendingAttributesForView { @Override public void resolveAttributeIfExists(String attribute, AttributeResolver attributeResolver) { if (attributeMappings.containsKey(attribute)) { String attributeValue = attributeMappings.get(attribute); try { attributeResolver.resolve(view, attribute, attributeValue); } catch (AttributeResolutionException e) { resolutionErrors.addAttributeError(e); } attributeMappings.remove(attribute); } } PendingAttributesForViewImpl(Object view, Map<String, String> attributeMappings); @Override Object getView(); @Override boolean isEmpty(); @Override ViewResolutionErrors getResolutionErrors(); @Override void resolveAttributeIfExists(String attribute, AttributeResolver attributeResolver); @Override void resolveAttributeGroupIfExists(String[] attributeGroup, AttributeGroupResolver attributeGroupResolver);  }### Answer:
@Test public void givenAttributeInPendingList_whenResolveAttributeIfExists_thenAttributeShouldBeResolved() { String attribute = "existingAttribute"; PendingAttributesForView pendingAttributesForView = createWithPendingList(attribute); pendingAttributesForView.resolveAttributeIfExists(attribute, attributeResolver); assertTrue(attributeResolver.isAttributeResolved(attribute)); }
@Test public void givenAttributeNotInPendingList_whenResolveAttributeIfExists_thenAttributeShouldBeIgnored() { String attribute = "nonExistingAttribute"; PendingAttributesForView pendingAttributesForView = createWithPendingList(); pendingAttributesForView.resolveAttributeIfExists(attribute, attributeResolver); assertFalse(attributeResolver.isAttributeResolved(attribute)); }