public ReducingStateDescriptor(
            String name, ReduceFunction<T> reduceFunction, Class<T> typeClass) {
        super(name, typeClass, null);
        this.reduceFunction = checkNotNull(reduceFunction);

        if (reduceFunction instanceof RichFunction) {
            throw new UnsupportedOperationException(
                    "ReduceFunction of ReducingState can not be a RichFunction.");
        }
    }
@Test
    void testReducingStateDescriptor() throws Exception {

        ReduceFunction<String> reducer = (a, b) -> a;

        TypeSerializer<String> serializer =
                new KryoSerializer<>(String.class, new SerializerConfigImpl());

        ReducingStateDescriptor<String> descr =
                new ReducingStateDescriptor<>("testName", reducer, serializer);

        assertThat(descr.getName()).isEqualTo("testName");
        assertThat(descr.getSerializer()).isNotNull();
        assertThat(descr.getSerializer()).isEqualTo(serializer);
        assertThat(descr.getReduceFunction()).isEqualTo(reducer);

        ReducingStateDescriptor<String> copy = CommonTestUtils.createCopySerializable(descr);

        assertThat(copy.getName()).isEqualTo("testName");
        assertThat(copy.getSerializer()).isNotNull();
        assertThat(copy.getSerializer()).isEqualTo(serializer);
    }