### Question:
PropertyParserFactory { public PropertyParser getParser(Class<?> type) { if (String.class.isAssignableFrom(type)) { return new StringPropertyParser(); } else if (Change.class.isAssignableFrom(type)) { return new ChangeDatePropertyParser(); } else if (Datable.class.isAssignableFrom(type)) { return new DatableFromYearPropertyParser(); } else if (Gender.class.isAssignableFrom(type)) { return new GenderPropertyParser(); } else if (PersonNames.class.isAssignableFrom(type)) { return new PersonNamesDefaultNamePropertyParser(); } else if (LocationNames.class.isAssignableFrom(type)) { return new DefaultLocationNamePropertyParser(); } else if (CollectiveType.class.isAssignableFrom(type)) { return new CollectiveTypePropertyParser(); } else if (DocumentType.class.isAssignableFrom(type)) { return new DocumentTypePropertyParser(); } else if (TempName.class.isAssignableFrom(type)) { return new TempNamePropertyParser(); } else if (List.class.isAssignableFrom(type)) { return new StringListParser(); } throw new UnparsableTypeException("Type " + type + " is not supported"); }  PropertyParser getParser(Class<?> type); PropertyParser getJoinedListParser(String seperator);  }### Answer:
@Test public void getParserReturnsAStringPropertyParserForString() { PropertyParser parser = instance.getParser(String.class); assertThat(parser, is(instanceOf(StringPropertyParser.class))); }
@Test(expected = UnparsableTypeException.class) public void getParserThrowsAUnparsableTypeExceptionWhenNoParserIsKnowForTheType() { instance.getParser(UnknownType.class); }
@Test public void getParserReturnsAChangeDatePropertyParserForChange() { PropertyParser parser = instance.getParser(Change.class); assertThat(parser, is(instanceOf(ChangeDatePropertyParser.class))); }
@Test public void getParserReturnsADatableFromYearPropertyParserForDatable() { PropertyParser parser = instance.getParser(Datable.class); assertThat(parser, is(instanceOf(DatableFromYearPropertyParser.class))); }
@Test public void getParserReturnsAGenderPropertyParserForGender() { PropertyParser parser = instance.getParser(Gender.class); assertThat(parser, is(instanceOf(GenderPropertyParser.class))); }
@Test public void getParserReturnsAPersonNamesDefaultPropertyParserForPersonNames() { PropertyParser parser = instance.getParser(PersonNames.class); assertThat(parser, is(instanceOf(PersonNamesDefaultNamePropertyParser.class))); }
@Test public void getParserReturnsAStringListParserForList() { PropertyParser parser = instance.getParser(List.class); assertThat(parser, is(instanceOf(StringListParser.class))); }
@Test public void getParserReturnsADefaultLocationNamePropertyParserForLocationNames() { PropertyParser parser = instance.getParser(LocationNames.class); assertThat(parser, is(instanceOf(DefaultLocationNamePropertyParser.class))); }