private static void serializeProperties(CheckpointProperties properties, DataOutputStream dos)
            throws IOException {
        new ObjectOutputStream(dos).writeObject(properties); // closed outside
    }
@Test
    void testSerializeProperties() throws IOException {
        CheckpointMetadata metadata =
                new CheckpointMetadata(
                        1L,
                        emptyList(),
                        emptyList(),
                        CheckpointProperties.forSavepoint(false, SavepointFormatType.NATIVE));

        MetadataSerializer instance = MetadataV4Serializer.INSTANCE;

        try (ByteArrayOutputStream out = new ByteArrayOutputStream();
                DataOutputStream dos = new DataOutputStream(out)) {
            instance.serialize(metadata, dos);

            try (DataInputStream dis =
                    new DataInputStream(new ByteArrayInputStream(out.toByteArray()))) {
                assertThat(
                                instance.deserialize(dis, metadata.getClass().getClassLoader(), "")
                                        .getCheckpointProperties())
                        .isEqualTo(metadata.getCheckpointProperties());
            }
        }
    }