### Question:
AnnotationValueAccess implements ValueAccess { @Override public <T> Object getPropertyValue(final T data, final EdmProperty property) throws ODataException { if (data == null) { return null; } else if (annotationHelper.isEdmAnnotated(data)) { return annotationHelper.getValueForProperty(data, property.getName()); } 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 getPropertyValue() throws ODataException { AnnotationValueAccess ava = new AnnotationValueAccess(); SimpleEntity data = new SimpleEntity(); data.name = "A Name"; EdmProperty property = mockProperty("Name"); Object value = ava.getPropertyValue(data, property); Assert.assertEquals(String.class, value.getClass()); Assert.assertEquals("A Name", value); }
@Test public void getPropertyValueNull() throws ODataException { AnnotationValueAccess ava = new AnnotationValueAccess(); SimpleEntity data = new SimpleEntity(); EdmProperty property = mockProperty("Name"); Object value = ava.getPropertyValue(data, property); Assert.assertNull(value); }
@Test public void getPropertyValueNullData() throws ODataException { AnnotationValueAccess ava = new AnnotationValueAccess(); SimpleEntity data = null; EdmProperty property = mockProperty("Name"); Object value = ava.getPropertyValue(data, property); Assert.assertNull(value); }
@Test(expected = ODataNotImplementedException.class) public void getPropertyValueNotAnnotated() throws ODataException { AnnotationValueAccess ava = new AnnotationValueAccess(); NotAnnotatedBean data = new NotAnnotatedBean(); EdmProperty property = mockProperty("Name"); Object value = ava.getPropertyValue(data, property); Assert.assertEquals("A Name", value); }