diff --git a/src/test/java/org/apache/commons/collections4/iterators/FilterIteratorTest.java b/src/test/java/org/apache/commons/collections4/iterators/FilterIteratorTest.java index 55344e68f..6087c3d0a 100644 --- a/src/test/java/org/apache/commons/collections4/iterators/FilterIteratorTest.java +++ b/src/test/java/org/apache/commons/collections4/iterators/FilterIteratorTest.java @@ -91,8 +91,9 @@ public class FilterIteratorTest extends AbstractIteratorTest { } } + @SuppressWarnings("unused") public void testRepeatedNext() { - for (@SuppressWarnings("unused") final String element : array) { + for (final String element : array) { iterator.next(); } verifyNoMoreElements(); diff --git a/src/test/java/org/apache/commons/collections4/iterators/IteratorIterableTest.java b/src/test/java/org/apache/commons/collections4/iterators/IteratorIterableTest.java index 419ccbf68..e504acf8d 100644 --- a/src/test/java/org/apache/commons/collections4/iterators/IteratorIterableTest.java +++ b/src/test/java/org/apache/commons/collections4/iterators/IteratorIterableTest.java @@ -45,6 +45,7 @@ public class IteratorIterableTest extends BulkTest { return iter; } + @SuppressWarnings("unused") public void testIterator() { final Iterator iter = createIterator(); final Iterable iterable = new IteratorIterable(iter); @@ -53,7 +54,7 @@ public class IteratorIterableTest extends BulkTest { verifyIteration(iterable); // second use - for (@SuppressWarnings("unused") final Number actual : iterable) { + for (final Number actual : iterable) { fail("should not be able to iterate twice"); } }