- changed status to resolved
TIntIntIterator does not work
Issue #18
invalid
here is a failing testcase:
<pre>
public void testIntIntHashMapIterator() {
TIntIntHashMap map = new TIntIntHashMap(2);
map.put(1,1);
map.put(2,2);
TIntIntIterator it = map.iterator();
assertEquals(1, it.key());
assertEquals(1, it.value());
assertTrue(it.hasNext());
it.advance();
assertTrue(it.hasNext());
}
</pre>
Comments (2)
-
reporter -
- changed status to invalid
It's on the Javadocs for the iterator classes. I can look at putting it on the FAQ also.
The other problem you'll have with your unit test is that ordering is not guaranteed with hash maps. So, you're check to make sure "1" comes out first is a risky one and wouldn't hold if you had more elements.
- Log in to comment
ok i understand now that I have to call advance before reading the first element. is that explained somewhere?