### Question:
FacetDescriptionFactory { public FacetDescription createListFacetDescription(String facetName, PropertyParser parser, String propertyName) { return new ListFacetDescription(facetName, propertyName, parser); } FacetDescriptionFactory(PropertyParserFactory parserFactory); FacetDescription createListFacetDescription(String facetName, PropertyParser parser, String propertyName); FacetDescription createListFacetDescription(String facetName, Class<?> typeToParse, String propertyName); FacetDescription createListFacetDescription(String facetName, PropertyParser parser, String propertyName,
                                                     String... relations); FacetDescription createListFacetDescription(String facetName, Class<?> typeToParse, String propertyName,
                                                     String... relations); FacetDescription createDerivedListFacetDescription(String facetName, String relationName,
                                                            Class<?> typeToParse, String propertyName,
                                                            String... relations); FacetDescription createDerivedListFacetDescription(String facetName, List<String> relationNames,
                                                            Class<?> typeToParse, String propertyName,
                                                            String... relations); FacetDescription createKeywordDescription(String facetName, String relationName, final String projectPrefix); FacetDescription createDerivedKeywordDescription(String facetName, String relationName,
                                                          final String projectPrefix, String... relations); FacetDescription createDatableRangeFacetDescription(String facetName, String propertyName,
                                                             String... relations); FacetDescription createDatableRangeFacetDescription(String facetName, String propertyName); FacetDescription createChangeRangeFacetDescription(String facetName, String propertyName); FacetDescription createMultiValueListFacetDescription(String facetName, String propertyName); FacetDescription createMultiValueListFacetDescription(String facetName, String propertyName,
                                                               String... relations); FacetDescription createEdgeFacetDescription(String facetName, String... relationNames); FacetDescription createDcarArchiveAndArchiverPeriodFacetDescription(String facetName, String startYear,
                                                                             String endYear); FacetDescription createJoinedListFacetDescription(String facetName, String propertyName, String separator); FacetDescription createAltNameFacetDescription(String facetName, String propertyName); FacetDescription createCharterFondsFacetDescription(String facetName);  }### Answer:
@Test public void createListFacetDescriptionCreatesAListFacetDescription() { PropertyParser parser = mock(PropertyParser.class); FacetDescription description = instance.createListFacetDescription("facetName", parser, "propertyName"); assertThat(description, is(instanceOf(ListFacetDescription.class))); }
@Test public void createListFacetLetsThePropertyParserFactoryCreateAParser() { FacetDescription description = instance.createListFacetDescription("facetName", String.class, "propertyName"); assertThat(description, is(notNullValue())); verify(parserFactory).getParser(String.class); }
@Test public void createListFacetDescriptionWithARelationCreatesADerivedListFacetDescription() { PropertyParser parser = mock(PropertyParser.class); FacetDescription description = instance.createListFacetDescription("facetName", parser, "propertyName", "relation"); assertThat(description, is(instanceOf(RelatedListFacetDescription.class))); }
@Test public void createListFacetDescriptionWithARelationLetsThePropertyParserFactoryCreateAParser() { FacetDescription description = instance.createListFacetDescription("facetName", String.class, "propertyName", "relation"); verify(parserFactory).getParser(String.class); }
@Test public void createListFacetDescriptionWithMultipleRelationsCreatesADerivedListFacetDescription() { PropertyParser parser = mock(PropertyParser.class); FacetDescription description = instance.createListFacetDescription("facetName", parser, "propertyName", "relation", "relation2"); assertThat(description, is(instanceOf(RelatedListFacetDescription.class))); }
@Test public void createListFacetDescriptionWithMultipleRelationsLetsThePropertyParserFactoryCreateAParser() { instance.createListFacetDescription("facetName", String.class, "propertyName", "relation", "relation2"); verify(parserFactory).getParser(String.class); }