@Test
    public void testConfigurationSerializationAndGetters() {
        try {
            final Configuration orig = new Configuration();
            orig.setString("mykey", "myvalue");
            orig.setInteger("mynumber", 100);
            orig.setLong("longvalue", 478236947162389746L);
            orig.setFloat("PI", 3.1415926f);
            orig.setDouble("E", Math.E);
            orig.setBoolean("shouldbetrue", true);
            orig.setBytes("bytes sequence", new byte[]{1, 2, 3, 4, 5});
            orig.setClass("myclass", this.getClass());

            final Configuration copy = InstantiationUtil
                    .deserializeObject(InstantiationUtil.serializeObject(orig),
                            Thread.currentThread().getContextClassLoader());
            assertEquals("myvalue", copy.getString("mykey", "null"));
            assertEquals(100, copy.getInteger("mynumber", 0));
            assertEquals(478236947162389746L, copy.getLong("longvalue", 0L));
            assertEquals(3.1415926f, copy.getFloat("PI", 3.1415926f), 0.0);
            assertEquals(Math.E, copy.getDouble("E", 0.0), 0.0);
            assertEquals(true, copy.getBoolean("shouldbetrue", false));
            assertArrayEquals(new byte[]{1, 2, 3, 4, 5}, copy.getBytes("bytes sequence", null));
            assertEquals(getClass(), copy.getClass("myclass", null, getClass().getClassLoader()));

            assertEquals(orig, copy);
            assertEquals(orig.keySet(), copy.keySet());
            assertEquals(orig.hashCode(), copy.hashCode());

        } catch (Exception e) {
            e.printStackTrace();
            fail(e.getMessage());
        }
    }
This test checks the serialization/deserialization of configuration objects.
inlong-sort/sort-common/src/test/java/org/apache/inlong/sort/configuration/ConfigurationTest.java