@Test
    public void testRemove() {
        Configuration cfg = new Configuration();
        cfg.setInteger("a", 1);
        cfg.setInteger("b", 2);

        ConfigOption<Integer> validOption = ConfigOptions
                .key("a")
                .defaultValue(-1);

        final ConfigOption<Integer> deprecatedOption = ConfigOptions
                .key("c")
                .defaultValue(-1)
                .withDeprecatedKeys("d", "b");

        final ConfigOption<Integer> unexistedOption = ConfigOptions
                .key("e")
                .defaultValue(-1)
                .withDeprecatedKeys("f", "g", "j");

        assertEquals("Wrong expectation about size", cfg.keySet().size(), 2);
        assertTrue("Expected 'validOption' is removed", cfg.removeConfig(validOption));
        assertEquals("Wrong expectation about size", cfg.keySet().size(), 1);
        assertTrue("Expected 'existedOption' is removed", cfg.removeConfig(deprecatedOption));
        assertEquals("Wrong expectation about size", cfg.keySet().size(), 0);
        assertFalse("Expected 'unexistedOption' is not removed", cfg.removeConfig(unexistedOption));
    }
This test checks the serialization/deserialization of configuration objects.
inlong-sort/sort-common/src/test/java/org/apache/inlong/sort/configuration/ConfigurationTest.java