### Question:
DutchCaribbeanArchiveAndArchiverPeriodFacetDescription implements FacetDescription { @Override public List<String> getValues(Vertex vertex) { List<String> values = Lists.newArrayList(); if (vertex.keys().contains(beginYear)) { values.add(vertex.value(beginYear)); } if (vertex.keys().contains(endYear)) { values.add(vertex.value(endYear)); } return values; } DutchCaribbeanArchiveAndArchiverPeriodFacetDescription(String facetName, String beginYear, String endYear);   DutchCaribbeanArchiveAndArchiverPeriodFacetDescription(String facetName, String beginYear, String endYear,
                                                         FacetGetter facetGetter); @Override String getName(); @Override Facet getFacet(Map<String, Set<Vertex>> values); @Override void filter(GraphTraversal<Vertex, Vertex> graphTraversal, List<FacetValue> facets); @Override List<String> getValues(Vertex vertex);  }### Answer:
@Test public void getValuesReturnsTheBeginPropertyAndEndPropertyOfAVertex() { String beginYear = "1900"; String endYear = "2000"; Vertex vertex = vertex().withProperty(BEGIN_YEAR, beginYear).withProperty(END_YEAR, endYear).build(); DutchCaribbeanArchiveAndArchiverPeriodFacetDescription instance = new DutchCaribbeanArchiveAndArchiverPeriodFacetDescription(FACET_NAME, BEGIN_YEAR, END_YEAR); List<String> values = instance.getValues(vertex); assertThat(values, containsInAnyOrder(beginYear, endYear)); }
@Test public void getValuesReturnsTheBeginDateIfTheEndDateIsNull() { String beginYear = "1900"; Vertex vertex = vertex().withProperty(BEGIN_YEAR, beginYear).build(); DutchCaribbeanArchiveAndArchiverPeriodFacetDescription instance = new DutchCaribbeanArchiveAndArchiverPeriodFacetDescription(FACET_NAME, BEGIN_YEAR, END_YEAR); List<String> values = instance.getValues(vertex); assertThat(values, contains(beginYear)); }
@Test public void getValuesReturnsTheEndDateIfTheBeginDateIsNull() { String endYear = "1900"; Vertex vertex = vertex().withProperty(END_YEAR, endYear).build(); DutchCaribbeanArchiveAndArchiverPeriodFacetDescription instance = new DutchCaribbeanArchiveAndArchiverPeriodFacetDescription(FACET_NAME, BEGIN_YEAR, END_YEAR); List<String> values = instance.getValues(vertex); assertThat(values, contains(endYear)); }
@Test public void getValuesReturnsAnEmptyListIfTheBeginDateAndTheEndDateAreNull() { Vertex vertex = vertex().build(); DutchCaribbeanArchiveAndArchiverPeriodFacetDescription instance = new DutchCaribbeanArchiveAndArchiverPeriodFacetDescription(FACET_NAME, BEGIN_YEAR, END_YEAR); List<String> values = instance.getValues(vertex); assertThat(values, is(empty())); }