public void testMapIteratorOrder() {
if (supportsFullIterator() == false) {
return;
}
OrderedMapIterator it = makeFullOrderedMapIterator();
Map map = getMap();
assertEquals("keySet() not consistent", new ArrayList(map.keySet()), new ArrayList(map.keySet()));
Iterator it2 = map.keySet().iterator();
assertEquals(true, it.hasNext());
assertEquals(true, it2.hasNext());
List list = new ArrayList();
while (it.hasNext()) {
Object key = it.next();
assertEquals(it2.next(), key);
list.add(key);
}
assertEquals(map.size(), list.size());
while (it.hasPrevious()) {
Object key = it.previous();
assertEquals(list.get(list.size() - 1), key);
list.remove(list.size() - 1);
}
assertEquals(0, list.size());
}