### Question:
AnnotationValueAccess implements ValueAccess { @Override public <T> Class<?> getPropertyType(final T data, final EdmProperty property) throws ODataException { if (data == null) { return null; } else if (annotationHelper.isEdmAnnotated(data)) { Class<?> fieldType = annotationHelper.getFieldTypeForProperty(data, property.getName()); if (fieldType == null) { throw new ODataException("No field type found for property " + property); } return fieldType; } 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 getPropertyType() throws ODataException { AnnotationValueAccess ava = new AnnotationValueAccess(); SimpleEntity data = new SimpleEntity(); data.name = "A Name"; EdmProperty property = mockProperty("Name"); Class<?> type = ava.getPropertyType(data, property); Assert.assertEquals(String.class, type); }
@Test public void getPropertyTypeNullData() throws ODataException { AnnotationValueAccess ava = new AnnotationValueAccess(); EdmProperty property = mockProperty("Name"); Class<?> type = ava.getPropertyType(null, property); Assert.assertNull(type); }
@Test(expected = ODataNotImplementedException.class) public void getPropertyTypeNotAnnotated() throws ODataException { AnnotationValueAccess ava = new AnnotationValueAccess(); NotAnnotatedBean data = new NotAnnotatedBean(); EdmProperty property = mockProperty("Name"); Class<?> type = ava.getPropertyType(data, property); Assert.assertEquals(String.class, type); }