lianetm commented on code in PR #15877:
URL: https://github.com/apache/kafka/pull/15877#discussion_r1594231539


##########
clients/src/test/java/org/apache/kafka/common/utils/ImplicitLinkedHashMultiCollectionTest.java:
##########
@@ -114,11 +114,11 @@ public void testEnlargement() {
             new TestElement(101),
             new TestElement(105)
         };
-        for (int i = 0; i < testElements.length; i++) {
-            assertTrue(multiSet.add(testElements[i]));
+        for (TestElement testElement : testElements) {
+            assertTrue(multiSet.add(testElement));
         }
-        for (int i = 0; i < testElements.length; i++) {
-            assertFalse(multiSet.add(testElements[i]));
+        for (TestElement testElement : testElements) {
+            assertFalse(multiSet.add(testElement));

Review Comment:
   could this be simplified to a single loop with the 2 asserts in it? we would 
achieve the same, validate an elem can be added only if new, for all elems. 



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to