snuyanzin commented on code in PR #28835:
URL: https://github.com/apache/flink/pull/28835#discussion_r3695518844


##########
flink-streaming-java/src/test/java/org/apache/flink/streaming/runtime/operators/windowing/ProcessingTimeSessionWindowsTest.java:
##########
@@ -224,4 +212,24 @@ void testDynamicGapProperties() {
         assertThat(assigner).isNotNull();
         assertThat(assigner.isEventTime()).isFalse();
     }
+
+    /**
+     * Matches a collection containing exactly the expected windows, in any 
order, counting
+     * duplicates.
+     */
+    private static Collection<TimeWindow> containsInAnyOrder(TimeWindow... 
windows) {
+        return argThat(
+                actual -> {
+                    if (actual == null) {
+                        return false;
+                    }
+                    final List<TimeWindow> remaining = new ArrayList<>(actual);
+                    for (TimeWindow window : windows) {
+                        if (!remaining.remove(window)) {
+                            return false;
+                        }
+                    }
+                    return remaining.isEmpty();
+                });
+    }

Review Comment:
   It does not look like a solution
   
   we have multiple tests using this method (hamcrest's `containsInAnyOrder`).
   
   How should we continue there? Create same helper for every class instead of 
hamcrest?
   Please do not blindly trust AI



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to