### Question:
MultiValuePropertyGetter implements PropertyValueGetter { @Override public List<String> getValues(Vertex vertex, String propertyName) { if (vertex.property(propertyName).isPresent()) { final String value = (String) vertex.property(propertyName).value(); try { return (List<String>) mapper.readValue(value, List.class); } catch (IOException e) { LOG.error("'{}' is not a valid multi valued field", value); } } return Lists.newArrayList(); }  @Override List<String> getValues(Vertex vertex, String propertyName); static final Logger LOG; }### Answer:
@Test public void getValuesReturnsEmptyListIfThePropertyIsNotPresent() { MultiValuePropertyGetter instance = new MultiValuePropertyGetter(); GraphTraversal<Vertex, Vertex> traversal = newGraph() .withVertex(v -> v.withProperty(PROPERTY_NOT_PRESENT, "[\"value1\"]").withTimId("1")) .withVertex(v -> v.withProperty(PROPERTY_NOT_PRESENT, "[\"value2\", \"value3\"]").withTimId("2")) .build().traversal().V(); List<List<String>> results = traversal.toList().stream() .map(v -> instance.getValues(v, PROPERTY)).collect(toList()); assertThat(results, contains(equalTo(Lists.newArrayList()), equalTo(Lists.newArrayList()))); }
@Test public void getValuesReturnsListOfStringsIfThePropertyIsPresent() { MultiValuePropertyGetter instance = new MultiValuePropertyGetter(); GraphTraversal<Vertex, Vertex> traversal = newGraph() .withVertex(v -> v.withProperty(PROPERTY, "[\"value2\", \"value3\"]").withTimId("2")) .build().traversal().V(); List<List<String>> results = traversal.toList().stream() .map(v -> instance.getValues(v, PROPERTY)).collect(toList()); assertThat(results.get(0), contains(is("value2"), is("value3"))); }