Index: trunk/test/unit/org/openstreetmap/josm/data/osm/QuadBucketsTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/data/osm/QuadBucketsTest.java	(revision 16546)
+++ trunk/test/unit/org/openstreetmap/josm/data/osm/QuadBucketsTest.java	(revision 16547)
@@ -53,10 +53,10 @@
         for (OsmPrimitive o: allNodes) {
             ds.removePrimitive(o);
-            Assert.assertEquals(--expectedCount, nodes.size());
+            checkIterator(nodes, --expectedCount);
         }
         expectedCount = allWays.size();
         for (OsmPrimitive o: allWays) {
             ds.removePrimitive(o);
-            Assert.assertEquals(--expectedCount, ways.size());
+            checkIterator(ways, --expectedCount);
         }
         for (OsmPrimitive o: allRelations) {
@@ -66,4 +66,14 @@
         Assert.assertTrue(ways.isEmpty());
         Assert.assertTrue(relations.isEmpty());
+    }
+
+    private void checkIterator(Iterable<? extends OsmPrimitive> col, int expectedCount) {
+        int count = 0;
+        Iterator<? extends OsmPrimitive> it = col.iterator();
+        while (it.hasNext()) {
+            count++;
+            it.next();
+        }
+        Assert.assertEquals(expectedCount, count);
     }
 
