diff --git a/src/main/java/org/apache/commons/collections4/iterators/SingletonIterator.java b/src/main/java/org/apache/commons/collections4/iterators/SingletonIterator.java index 042d06766..990489de3 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/SingletonIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/SingletonIterator.java @@ -106,10 +106,9 @@ public class SingletonIterator if (removeAllowed) { if (removed || beforeFirst) { throw new IllegalStateException(); - } else { - object = null; - removed = true; } + object = null; + removed = true; } else { throw new UnsupportedOperationException(); }