diff --git a/src/test/org/apache/commons/collections/map/TestLRUMap.java b/src/test/org/apache/commons/collections/map/TestLRUMap.java index da590b7c7..7fe780e3f 100644 --- a/src/test/org/apache/commons/collections/map/TestLRUMap.java +++ b/src/test/org/apache/commons/collections/map/TestLRUMap.java @@ -475,8 +475,7 @@ public class TestLRUMap extends AbstractTestOrderedMap { } catch (IndexOutOfBoundsException ex) {} } - // TODO: COLLECTIONS-330 - public void todoTestSynchronizedRemoveFromMapIterator() throws InterruptedException { + public void testSynchronizedRemoveFromMapIterator() throws InterruptedException { final LRUMap map = new LRUMap(10000); @@ -511,8 +510,8 @@ public class TestLRUMap extends AbstractTestOrderedMap { } synchronized (map) { for (MapIterator iter = map.mapIterator(); iter.hasNext();) { - String name = (String)iter.next(); - if (map.get(name) == this) { + iter.next(); + if (iter.getValue() == this) { iter.remove(); } } @@ -642,8 +641,7 @@ public class TestLRUMap extends AbstractTestOrderedMap { + counter[0] + " did succeed", counter[0] >= threads.length); } - // TODO: COLLECTIONS-330 - public void todoTestSynchronizedRemoveFromKeySet() throws InterruptedException { + public void testSynchronizedRemoveFromKeySet() throws InterruptedException { final Map map = new LRUMap(10000); @@ -678,8 +676,8 @@ public class TestLRUMap extends AbstractTestOrderedMap { } synchronized (map) { for (Iterator iter = map.keySet().iterator(); iter.hasNext();) { - String name = (String)iter.next(); - if (map.get(name) == this) { + String name = (String) iter.next(); + if (name.substring(0, name.indexOf('[')).equals(getName())) { iter.remove(); } }