@Override
    public <T> ListState<T> getListState(ListStateDescriptor<T> stateProperties) {
        KeyedStateStore keyedStateStore = checkPreconditionsAndGetKeyedStateStore(stateProperties);
        stateProperties.initializeSerializerUnlessSet(this::createSerializer);
        return keyedStateStore.getListState(stateProperties);
    }
@Test
    void testV2ListStateInstantiation() throws Exception {
        final ExecutionConfig config = new ExecutionConfig();
        SerializerConfig serializerConfig = config.getSerializerConfig();
        serializerConfig.registerKryoType(Path.class);

        final AtomicReference<Object> descriptorCapture = new AtomicReference<>();

        StreamingRuntimeContext context = createRuntimeContext(descriptorCapture, config);
        org.apache.flink.runtime.state.v2.ListStateDescriptor<TaskInfo> descr =
                new org.apache.flink.runtime.state.v2.ListStateDescriptor<>(
                        "name", TypeInformation.of(TaskInfo.class), serializerConfig);
        context.getListState(descr);

        org.apache.flink.runtime.state.v2.ListStateDescriptor<?> descrIntercepted =
                (org.apache.flink.runtime.state.v2.ListStateDescriptor<?>) descriptorCapture.get();
        TypeSerializer<?> serializer = descrIntercepted.getSerializer();

        // check that the Path class is really registered, i.e., the execution config was applied
        assertThat(serializer).isInstanceOf(KryoSerializer.class);
        assertThat(((KryoSerializer<?>) serializer).getKryo().getRegistration(Path.class).getId())
                .isPositive();
    }