mbaedke commented on code in PR #3144:
URL: https://github.com/apache/jackrabbit-oak/pull/3144#discussion_r4092865693


##########
oak-commons/src/test/java/org/apache/jackrabbit/oak/commons/collections/IteratorUtilsTest.java:
##########
@@ -818,6 +821,17 @@ public void testChainedIteratorsHasNull() {
         Assert.assertThrows(NullPointerException.class, () -> 
IteratorUtils.chainedIterator(new ArrayList<>(Arrays.asList(iterator1, 
iterator2, null)).iterator()));
     }
 
+    @Test
+    // OAK-12410
+    public void testChainedIteratorsAfterHasNextCall() {
+        Iterator<String> subChain = IteratorUtils.chainedIterator(
+                Collections.singleton("a").iterator(),
+                Collections.singleton("b").iterator());
+        assertTrue(subChain.hasNext());
+        Iterator<String> mainChain = IteratorUtils.chainedIterator(subChain, 
Collections.singleton("c").iterator());
+        assertEquals("a", mainChain.next());
+    }

Review Comment:
   While that is technically true, a bug like that never existed. Why would we 
test random behavior?



-- 
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