Skip to content

Commit

Permalink
An empty iterator should throw a NoSuchElementException
Browse files Browse the repository at this point in the history
  • Loading branch information
JervenBolleman committed Mar 15, 2024
1 parent bbcbd1e commit e137af4
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
package io.github.jervenbolleman.handlegraph4j.iterators;

import java.util.Iterator;
import java.util.NoSuchElementException;
import java.util.PrimitiveIterator.OfLong;
import java.util.function.Function;
import java.util.function.LongFunction;
Expand Down Expand Up @@ -339,7 +340,7 @@ public boolean hasNext() {

@Override
public T next() {
throw new IllegalStateException();
throw new NoSuchElementException();
}
};
}
Expand Down

0 comments on commit e137af4

Please sign in to comment.