@Test
    public void testOptionWithDefault() {
        Configuration cfg = new Configuration();
        cfg.setInteger("int-key", 11);
        cfg.setString("string-key", "abc");

        ConfigOption<String> presentStringOption = ConfigOptions.key("string-key")
                .defaultValue("my-beautiful-default");
        ConfigOption<Integer> presentIntOption = ConfigOptions.key("int-key").defaultValue(87);

        assertEquals("abc", cfg.getString(presentStringOption));
        assertEquals("abc", cfg.getValue(presentStringOption));

        assertEquals(11, cfg.getInteger(presentIntOption));
        assertEquals("11", cfg.getValue(presentIntOption));

        // test getting default when no value is present

        ConfigOption<String> stringOption = ConfigOptions.key("test")
                .defaultValue("my-beautiful-default");
        final ConfigOption<Integer> intOption = ConfigOptions.key("test2").defaultValue(87);

        // getting strings with default value should work
        assertEquals("my-beautiful-default", cfg.getValue(stringOption));
        assertEquals("my-beautiful-default", cfg.getString(stringOption));

        // overriding the default should work
        assertEquals("override", cfg.getString(stringOption, "override"));

        // getting a primitive with a default value should work
        assertEquals(87, cfg.getInteger(intOption));
        assertEquals("87", cfg.getValue(intOption));
    }
This test checks the serialization/deserialization of configuration objects.
inlong-sort/sort-common/src/test/java/org/apache/inlong/sort/configuration/ConfigurationTest.java