public DurationConfParser durationConf() {
    return new DurationConfParser();
  }
@Test
  public void testDurationConf() {
    Map<String, String> writeOptions = ImmutableMap.of("write-prop", "111s");

    ConfigOption<Duration> configOption =
        ConfigOptions.key("conf-prop").durationType().noDefaultValue();
    Configuration flinkConf = new Configuration();
    flinkConf.setString(configOption.key(), "222s");

    Table table = mock(Table.class);
    when(table.properties()).thenReturn(ImmutableMap.of("table-prop", "333s"));

    FlinkConfParser confParser = new FlinkConfParser(table, writeOptions, flinkConf);
    Duration defaultVal = Duration.ofMillis(999);

    Duration result =
        confParser.durationConf().option("write-prop").defaultValue(defaultVal).parse();
    assertThat(result).isEqualTo(Duration.ofSeconds(111));

    result = confParser.durationConf().flinkConfig(configOption).defaultValue(defaultVal).parse();
    assertThat(result).isEqualTo(Duration.ofSeconds(222));

    result = confParser.durationConf().tableProperty("table-prop").defaultValue(defaultVal).parse();
    assertThat(result).isEqualTo(Duration.ofSeconds(333));
  }