BUG-7464: Update pom.xml
[yangtools.git] / third-party / triemap / src / test / java / org / opendaylight / yangtools / triemap / TestHashCollisionsRemoveIterator.java
1 package org.opendaylight.yangtools.triemap;
2
3 import java.util.ArrayList;
4 import java.util.Collection;
5 import java.util.Iterator;
6 import java.util.Map;
7 import java.util.Map.Entry;
8
9 import org.junit.Test;
10
11 public class TestHashCollisionsRemoveIterator {
12     @Test
13     public void testHashCollisionsRemoveIterator () {
14         final Map<Object, Object> bt = new TrieMap<Object, Object> ();
15         int count = 50000;
16         for (int j = 0; j < count; j++) {
17             bt.put (Integer.valueOf (j), Integer.valueOf (j));
18         }
19         
20         final Collection<Object> list = new ArrayList <Object> ();
21         for (final Iterator<Map.Entry<Object, Object>> i = bt.entrySet ().iterator (); i.hasNext ();) {
22             final Entry<Object, Object> e = i.next ();
23             final Object key = e.getKey ();
24             list.add (key);
25             i.remove ();
26         }
27
28         TestHelper.assertEquals (0, bt.size ());
29         TestHelper.assertTrue (bt.isEmpty ());
30     }
31 }