Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.7.6
-
None
-
None
-
Docs Required, Release Notes Required
Description
Simple reproducer below will throw NoSuchElementException.
Iterator only works if one call hasNext before next.
/** */ @Test public void testReadOnlyCollection() throws Exception { Collection<String> c1 = Collections.emptyList(); Collection<String> c2 = Arrays.asList("1"); ReadOnlyCollectionView2X<String> view = new ReadOnlyCollectionView2X<>(c1, c2); assertEquals("1", view.iterator().next()); }