### Question:
LinkkiConverterFactory extends DefaultConverterFactory { @Override @CheckForNull protected <PRESENTATION, MODEL> Converter<PRESENTATION, MODEL> findConverter( @CheckForNull Class<PRESENTATION> presentationType, @CheckForNull Class<MODEL> modelType) { @SuppressWarnings("unchecked") @CheckForNull Converter<PRESENTATION, MODEL> converter = converterFinder.get().stream() .filter(Converter.class::isInstance) .map(Converter.class::cast) .filter(c -> c.getPresentationType().isAssignableFrom(presentationType) && c.getModelType().isAssignableFrom(modelType)) .findFirst() .orElseGet(() -> super.findConverter(presentationType, modelType)); return converter; } LinkkiConverterFactory();  LinkkiConverterFactory(Supplier<Sequence<Converter<?, ?>>> converterFinder);  static final Sequence<Converter<?, ?>> DEFAULT_JAVA_8_DATE_CONVERTERS; }### Answer:
@Test public void testFindConverter_noneRegistered() { LinkkiConverterFactory linkkiConverterFactory = new LinkkiConverterFactory(() -> Sequence.empty()); assertThat(linkkiConverterFactory.findConverter(String.class, Date.class), is(instanceOf(StringToDateConverter.class))); assertThat(linkkiConverterFactory.findConverter(String.class, java.time.LocalDate.class), is(nullValue())); assertThat(linkkiConverterFactory.findConverter(String.class, org.joda.time.LocalDate.class), is(nullValue())); }
@Test public void testFindConverter_allRegistered() { LinkkiConverterFactory linkkiConverterFactory = new LinkkiConverterFactory( () -> Sequence.of(new JodaLocalDateToStringConverter(), new JodaLocalDateTimeToStringConverter(), new JodaLocalDateToDateConverter(), new LocalDateToStringConverter(), new LocalDateTimeToStringConverter(), new LocalDateToDateConverter())); assertThat(linkkiConverterFactory.findConverter(String.class, Date.class), is(instanceOf(StringToDateConverter.class))); assertThat(linkkiConverterFactory.findConverter(String.class, java.time.LocalDate.class), is(instanceOf(LocalDateToStringConverter.class))); assertThat(linkkiConverterFactory.findConverter(String.class, org.joda.time.LocalDate.class), is(instanceOf(JodaLocalDateToStringConverter.class))); assertThat(linkkiConverterFactory.findConverter(String.class, java.time.LocalDateTime.class), is(instanceOf(LocalDateTimeToStringConverter.class))); assertThat(linkkiConverterFactory.findConverter(String.class, org.joda.time.LocalDateTime.class), is(instanceOf(JodaLocalDateTimeToStringConverter.class))); assertThat(linkkiConverterFactory.findConverter(Date.class, java.time.LocalDate.class), is(instanceOf(LocalDateToDateConverter.class))); assertThat(linkkiConverterFactory.findConverter(Date.class, org.joda.time.LocalDate.class), is(instanceOf(JodaLocalDateToDateConverter.class))); }
@Test public void testFindConverter_overrideDefault() { LinkkiConverterFactory linkkiConverterFactory = new LinkkiConverterFactory( () -> Sequence.of(new MyStringToDateConverter())); assertThat(linkkiConverterFactory.findConverter(String.class, Date.class), is(instanceOf(MyStringToDateConverter.class))); }