### Question:
DefaultConverterExtractor implements ParameterConverterExtractor<List<Parameter.Schema>> { @Override public Optional<Parameter.Converter>[] extract(final List<Parameter.Schema> schemas) { return schemas.stream() .sorted(Comparator.comparingInt(Parameter.Schema::getOverallOrder)) .map( schema -> this.defaultConverters.stream().filter(c -> c.test(schema.getType())).findFirst()) .toArray(Optional[]::new); } DefaultConverterExtractor(final List<Parameter.RegistrableConverter> defaultConverters); @Override Optional<Parameter.Converter>[] extract(final List<Parameter.Schema> schemas);  }### Answer:
@Test public void assignConverters() { final Parameter.RegistrableConverter converter; final List<Parameter.RegistrableConverter> converters; final DefaultConverterExtractor extractor; final Parameter.Schema stringParameter, integerParameter; final List<Parameter.Schema> parameters; final Optional<Parameter.Converter>[] parametersConverters; given: converter = Mockito.mock(Parameter.RegistrableConverter.class); converters = singletonList(converter); extractor = new DefaultConverterExtractor(converters); stringParameter = schema() .name("STRING_PARAMETER") .overallOrder(0) .step(Scenario.StepType.REQUISITE) .type(String.class) .build(); integerParameter = schema() .name("INTEGER_PARAMETER") .overallOrder(1) .step(Scenario.StepType.EXPECTATION) .type(int.class) .build(); parameters = Arrays.asList(stringParameter, integerParameter); orchestrate: Mockito.when(converter.test(String.class)).thenReturn(true); when: parametersConverters = extractor.extract(parameters); then: Assertions.assertThat(parametersConverters) .hasSize(2) .containsExactly(Optional.of(converter), Optional.empty()); verification: Mockito.verify(converter, times(1)).test(String.class); Mockito.verify(converter, times(1)).test(int.class); Mockito.verifyNoMoreInteractions(converter); }