### Question:
RawConfigParser implements ConfigParser<RawConfig, Config> { @Override public @NonNull Config parse(final @Nullable RawConfig config) { Objects.requireNonNull(config); final ProducerConfig producerConfig = producerConfigParser.parse(config.producer, RawProducerConfig::new); final RecordsConfig recordsConfig = recordsConfigParser.parse(config.records, RawRecordsConfig::new); final Integer maxInFlightRecords = get(config.maxInFlightRecords, DEFAULT_MAX_IN_FLIGHT_RECORDS); final Duration inFlightRecordCheckInterval = get( config.inFlightRecordCheckIntervalMs, DEFAULT_IN_FLIGHT_RECORD_CHECK_INTERVAL, Duration::ofMillis); return new Config( producerConfig, recordsConfig, maxInFlightRecords, inFlightRecordCheckInterval); } RawConfigParser();   RawConfigParser(
      final @NonNull ConfigParser<RawRecordsConfig, RecordsConfig> recordsConfigParser,
      final @NonNull ConfigParser<RawProducerConfig, ProducerConfig> producerConfigParser); @Override @NonNull Config parse(final @Nullable RawConfig config);  }### Answer:
@Test public void shouldUseDefaultValues() { final RawConfig config = new RawConfig(); final Config parsed = parser.parse(config); assertThat(parsed.getRecords()).isEqualTo(recordsConfigParser.parse(new RawRecordsConfig())); assertThat(parsed.getProducer()).isEqualTo(producerConfigParser.parse(new RawProducerConfig())); assertThat(parsed.getMaxInFlightRecords()) .isEqualTo(RawConfigParser.DEFAULT_MAX_IN_FLIGHT_RECORDS); assertThat(parsed.getInFlightRecordCheckInterval()) .isEqualTo(RawConfigParser.DEFAULT_IN_FLIGHT_RECORD_CHECK_INTERVAL); }
@Test public void shouldParse() { final RawConfig config = new RawConfig(); final ProducerConfig producerConfig = producerConfigParser.parse(new RawProducerConfig()); final RecordsConfig recordsConfig = recordsConfigParser.parse(new RawRecordsConfig()); config.maxInFlightRecords = 2; config.inFlightRecordCheckIntervalMs = 500L; final Config parsed = parser.parse(config); assertThat(parsed.getProducer()).isEqualTo(producerConfig); assertThat(parsed.getRecords()).isEqualTo(recordsConfig); assertThat(parsed.getMaxInFlightRecords()).isEqualTo(2); assertThat(parsed.getInFlightRecordCheckInterval()).isEqualTo(Duration.ofMillis(500)); }