VertexWrapper { public Collection<String> getPropertyKeys() { Collection<String> propertyKeys = new TreeSet<>(resourceComparator); for (String p : vertex.getPropertyKeys()) { String cleanName = propertyMapper.toCleanName(p, vertexType); if (! removedProperties.contains(cleanName)) { propertyKeys.add(cleanName); } } return propertyKeys; } 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();  }
@Test public void testGetPropertyKeys() { String testType = "testType"; Set<String> propertyKeys = new HashSet<>(); propertyKeys.add("foobar"); propertyKeys.add("Prefix.foo"); propertyKeys.add("Prefix.bar"); Vertex v = createStrictMock(Vertex.class); PropertyMapper propertyMapper = createMock(PropertyMapper.class); expect(v.<String>getProperty(Constants.ENTITY_TYPE_PROPERTY_KEY)).andReturn(testType); expect(v.getPropertyKeys()).andReturn(propertyKeys); expect(propertyMapper.toCleanName("Prefix.bar", testType)).andReturn("bar"); expect(propertyMapper.toCleanName("Prefix.foo", testType)).andReturn("foo"); expect(propertyMapper.toCleanName("foobar", testType)).andReturn("foobar"); replay(v, propertyMapper); VertexWrapper vWrapper = new VertexWrapper(v, propertyMapper, Collections.<String, PropertyValueFormatter>emptyMap()); Collection<String> resultKeys = vWrapper.getPropertyKeys(); Iterator<String> propIterator = resultKeys.iterator(); assertEquals(resultKeys.size(), 3); assertEquals(propIterator.next(), "bar"); assertEquals(propIterator.next(), "foo"); assertEquals(propIterator.next(), "foobar"); verify(v, propertyMapper); }