### Question:
AnnotationValueAccess implements ValueAccess { @Override public <T, V> void setPropertyValue(final T data, final EdmProperty property, final V value) throws ODataException { if (data != null) { if (annotationHelper.isEdmAnnotated(data)) { annotationHelper.setValueForProperty(data, property.getName(), value); } else { throw new ODataNotImplementedException(ODataNotImplementedException.COMMON); } } }  @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 setPropertyValue() throws ODataException { AnnotationValueAccess ava = new AnnotationValueAccess(); SimpleEntity data = new SimpleEntity(); data.name = "A Name"; EdmProperty property = mockProperty("Name"); Object value = "Another Name"; ava.setPropertyValue(data, property, value); Assert.assertEquals("Another Name", data.name); }
@Test(expected = ODataNotImplementedException.class) public void setPropertyValueNotAnnotated() throws ODataException { AnnotationValueAccess ava = new AnnotationValueAccess(); NotAnnotatedBean data = new NotAnnotatedBean(); EdmProperty property = mockProperty("Name"); Object value = "Another Name"; ava.setPropertyValue(data, property, value); }
@Test public void setPropertyValueNull() throws ODataException { AnnotationValueAccess ava = new AnnotationValueAccess(); SimpleEntity data = new SimpleEntity(); data.name = "A Name"; EdmProperty property = mockProperty("Name"); ava.setPropertyValue(data, property, null); Assert.assertNull(null, data.name); }
@Test public void setPropertyDataNull() throws ODataException { AnnotationValueAccess ava = new AnnotationValueAccess(); SimpleEntity data = null; EdmProperty property = mockProperty("Name"); ava.setPropertyValue(data, property, null); }