@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))); }
@Override public List<String> getValues(Vertex vertex, String propertyName) { if (vertex.property(propertyName).isPresent()) { return Lists.newArrayList((String) vertex.property(propertyName).value()); } return null; }
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; } }
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; }  }
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); }
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);  }