### Question:
LocalPropertyValueGetter implements PropertyValueGetter { @Override public List<String> getValues(Vertex vertex, String propertyName) { if (vertex.property(propertyName).isPresent()) { return Lists.newArrayList((String) vertex.property(propertyName).value()); } return null; }  @Override List<String> getValues(Vertex vertex, String propertyName);  }### Answer:
@Test public void getValuesReturnsNullIfThePropertyIsNotPresent() { LocalPropertyValueGetter instance = new LocalPropertyValueGetter(); GraphTraversal<Vertex, Vertex> traversal = newGraph() .withVertex(v -> v.withProperty(PROPERTY_NOT_PRESENT, "value1").withTimId("1")) .withVertex(v -> v.withProperty(PROPERTY_NOT_PRESENT, "value2").withTimId("2")) .build().traversal().V(); List<List<String>> results = traversal.toList().stream() .map(v -> instance.getValues(v, PROPERTY)).collect(toList()); assertThat(results, contains(equalTo(null), equalTo(null))); }
@Test public void getValuesReturnsListOfStringsIfThePropertyIsPresent() { LocalPropertyValueGetter instance = new LocalPropertyValueGetter(); GraphTraversal<Vertex, Vertex> traversal = newGraph() .withVertex(v -> v.withProperty(PROPERTY, "value1").withTimId("1")) .build().traversal().V(); List<List<String>> results = traversal.toList().stream() .map(v -> instance.getValues(v, PROPERTY)).collect(toList()); assertThat(results.get(0), contains(is("value1"))); }