VertexWrapper { public <T> T getProperty(String name) { T val; if (removedProperties.contains(name)) { val = null; } else { val = vertex.getProperty(propertyMapper.toFullyQualifiedName(name, vertexType)); if (propertyValueFormatters.containsKey(name)) { val = (T) propertyValueFormatters.get(name).format(val); } } return val; } VertexWrapper(Vertex v, ResourceDefinition resourceDefinition);  VertexWrapper(Vertex v,
                         PropertyMapper mapper,
                         Map<String, PropertyValueFormatter> formatters); Vertex getVertex(); T getProperty(String name); void setProperty(String name, Object value); Collection<String> getPropertyKeys(); Map<String, Object> getPropertyMap(); void removeProperty(String name); boolean isPropertyRemoved(String name); String toString();  }
@SuppressWarnings("unchecked") @Test public void testGetProperty() { String testType = "testType"; String propName = "propName"; String qualifiedPropName = "Prefix.propName"; String propValue = "val"; String formattedValue = "value"; Vertex v = createStrictMock(Vertex.class); PropertyMapper propertyMapper = createStrictMock(PropertyMapper.class); PropertyValueFormatter formatter = createStrictMock(PropertyValueFormatter.class); expect(v.<String>getProperty(Constants.ENTITY_TYPE_PROPERTY_KEY)).andReturn(testType); expect(propertyMapper.toFullyQualifiedName(propName, testType)).andReturn(qualifiedPropName); expect(v.getProperty(qualifiedPropName)).andReturn(propValue); expect(formatter.format(propValue)).andReturn((formattedValue)); replay(v, propertyMapper, formatter); VertexWrapper vWrapper = new VertexWrapper(v, propertyMapper, Collections.singletonMap(propName, formatter)); assertEquals(vWrapper.getProperty(propName), formattedValue); vWrapper.removeProperty(propName); assertNull(vWrapper.getProperty(propName)); verify(v, propertyMapper, formatter); }