diff --git a/core-java/src/test/java/com/baeldung/java/list/CustomListUnitTest.java b/core-java/src/test/java/com/baeldung/java/list/CustomListUnitTest.java index 898ea02f16..3ee3195e80 100644 --- a/core-java/src/test/java/com/baeldung/java/list/CustomListUnitTest.java +++ b/core-java/src/test/java/com/baeldung/java/list/CustomListUnitTest.java @@ -276,7 +276,7 @@ public class CustomListUnitTest { list.add("baeldung"); Iterator iterator = list.iterator(); - assertTrue(iterator.hasNext()); + iterator.next(); assertFalse(iterator.hasNext()); } }