From 90634a969a74772fd2362afd0301871e4c117404 Mon Sep 17 00:00:00 2001 From: Sebastian Bazley Date: Sun, 28 Apr 2013 22:59:14 +0000 Subject: [PATCH] Simplify and avoid complaints about "dead store to actual" git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1476852 13f79535-47bb-0310-9956-ffa450edef68 --- .../commons/collections4/IteratorUtilsTest.java | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/test/java/org/apache/commons/collections4/IteratorUtilsTest.java b/src/test/java/org/apache/commons/collections4/IteratorUtilsTest.java index 29b3d25a7..4ca3b2946 100644 --- a/src/test/java/org/apache/commons/collections4/IteratorUtilsTest.java +++ b/src/test/java/org/apache/commons/collections4/IteratorUtilsTest.java @@ -75,9 +75,7 @@ public class IteratorUtilsTest extends BulkTest { assertTrue(expected > 0); // single use iterator - for(@SuppressWarnings("unused") final Integer actual : iterable) { - fail("should not be able to iterate twice"); - } + assertFalse("should not be able to iterate twice", IteratorUtils.asIterable(iterator).iterator().hasNext()); } public void testAsIterableNull() { @@ -815,9 +813,7 @@ public class IteratorUtilsTest extends BulkTest { assertTrue(expectedNodeIndex > 0); // single use iterator - for (@SuppressWarnings("unused") final Node actual : IteratorUtils.asIterable(iterator)) { - fail("should not be able to iterate twice"); - } + assertFalse("should not be able to iterate twice", IteratorUtils.asIterable(iterator).iterator().hasNext()); } /** * Tests method nodeListIterator(Node) @@ -840,9 +836,7 @@ public class IteratorUtilsTest extends BulkTest { assertTrue(expectedNodeIndex > 0); // single use iterator - for (@SuppressWarnings("unused") final Node actual : IteratorUtils.asIterable(iterator)) { - fail("should not be able to iterate twice"); - } + assertFalse("should not be able to iterate twice", IteratorUtils.asIterable(iterator).iterator().hasNext()); } /**