### Question:
AnnotationValueAccess implements ValueAccess { @Override public <T, V> void setMappingValue(final T data, final EdmMapping mapping, final V value) throws ODataException { if (mapping != null && mapping.getMediaResourceMimeTypeKey() != null) { annotationHelper.setValueForProperty(data, mapping.getMediaResourceMimeTypeKey(), value); } }  @Override Object getPropertyValue(final T data, final EdmProperty property); @Override void setPropertyValue(final T data, final EdmProperty property, final V value); @Override Class<?> getPropertyType(final T data, final EdmProperty property); @Override Object getMappingValue(final T data, final EdmMapping mapping); @Override void setMappingValue(final T data, final EdmMapping mapping, final V value);  }### Answer:
@Test public void setMappingValue() throws Exception { AnnotationValueAccess ava = new AnnotationValueAccess(); SimpleEntity data = new SimpleEntity(); data.myMappedProperty = "mapped property value"; EdmMapping mapping = mockMapping("MyMappedProperty"); Object value = "Changed mapped property value"; ava.setMappingValue(data, mapping, value); Assert.assertEquals("Changed mapped property value", data.myMappedProperty); }
@Test public void setMappingValueNullValue() throws Exception { AnnotationValueAccess ava = new AnnotationValueAccess(); SimpleEntity data = new SimpleEntity(); data.myMappedProperty = "mapped property value"; EdmMapping mapping = mockMapping("MyMappedProperty"); Object value = null; ava.setMappingValue(data, mapping, value); Assert.assertNull(data.myMappedProperty); }
@Test public void setMappingValueNullMapping() throws Exception { AnnotationValueAccess ava = new AnnotationValueAccess(); SimpleEntity data = new SimpleEntity(); data.myMappedProperty = "mapped property value"; EdmMapping mapping = null; Object value = null; ava.setMappingValue(data, mapping, value); Assert.assertEquals("mapped property value", data.myMappedProperty); }