Github user aljoscha commented on a diff in the pull request: https://github.com/apache/flink/pull/5732#discussion_r176219956 --- Diff: flink-core/src/test/java/org/apache/flink/api/common/state/AggregatingStateDescriptorTest.java --- @@ -41,16 +40,11 @@ * <p>Tests that the returned serializer is duplicated. This allows to * share the state descriptor. */ - @SuppressWarnings("unchecked") @Test public void testSerializerDuplication() { - TypeSerializer<Long> serializer = mock(TypeSerializer.class); - when(serializer.duplicate()).thenAnswer(new Answer<TypeSerializer<Long>>() { - @Override - public TypeSerializer<Long> answer(InvocationOnMock invocation) throws Throwable { - return mock(TypeSerializer.class); - } - }); + // we need a serializer that actually duplicates for testing (a stateful one) --- End diff -- Will this condition always hold? Should we maybe guard this assumption with an assertion, i.e. assert that the result of `serialiser.duplicate()` is different from the original serialiser?
---