### Question:
PropertyDescriptorFactory { public PropertyDescriptor getLocal(String propertyName, PropertyParser parser) { return new LocalPropertyDescriptor(propertyName, parser); } PropertyDescriptorFactory(PropertyParserFactory parserFactory); PropertyDescriptor getLocal(String propertyName, PropertyParser parser); PropertyDescriptor getLocal(String propertyName, Class<?> typeToParse); PropertyDescriptor getLocal(String propertyName, PropertyParser parser, String prefix, String postfix); PropertyDescriptor getLocal(String propertyName, Class<?> typeToConvert, String prefix, String postfix); PropertyDescriptor getLocal(String propertyName, String separator); PropertyDescriptor getComposite(PropertyDescriptor preferred, PropertyDescriptor backUp); PropertyDescriptor getDerived(String relationName, String propertyName, String acceptedPropertyName,
                                       Class<?> typeToParse); PropertyDescriptor getDerivedWithSeparator(String relationName, String propertyName, PropertyParser parser,
                                                    String acceptedPropertyName, String separator); PropertyDescriptor getAppender(PropertyDescriptor first, PropertyDescriptor second, String separator);  }### Answer:
@Test public void getLocalWithPropertyNameAndParserReturnsALocalPropertyDescriptor() { PropertyParser parser = mock(PropertyParser.class); PropertyDescriptor descriptor = instance.getLocal("propertyName", parser); assertThat(descriptor, is(instanceOf(LocalPropertyDescriptor.class))); }
@Test public void getLocalWithPrefixAndPostfixReturnsLocalPropertyDescriptor() { PropertyParser parser = mock(PropertyParser.class); PropertyDescriptor descriptor = instance.getLocal("propertyName", parser, "prefix", "postfix"); assertThat(descriptor, is(instanceOf(LocalPropertyDescriptor.class))); }
@Test public void getLocalLetsThePropertyParserFactoryCreateAPropertyParser() { instance.getLocal("propertyName", String.class); verify(parserFactory).getParser(String.class); }
@Test public void getLocalWithPrefixAndPostfixLetsThePropertyParserFactoryCreateAPropertyParser() { instance.getLocal("propertyName", String.class, "prefix", "postfix"); verify(parserFactory).getParser(String.class); }