### Question:
DBFieldMap { public LongIterator iterator() { return new MapLongIterator(); } DBFieldMap(Class<? extends Field> fieldClass, int cacheSizeMB); void dispose(); void addEntry(Field fieldValue, long longValue); boolean deleteEntry(Field fieldValue, long longValue); LongIterator iterator();  }### Answer:
@Test public void testIterator() { addEntries(); LongIterator iter = map.iterator(); assertEquals(1, iter.next()); assertEquals(2, iter.next()); assertEquals(3, iter.next()); assertEquals(4, iter.next()); assertEquals(5, iter.next()); assertEquals(6, iter.next()); try { iter.next(); Assert.fail(); } catch (NoSuchElementException e) { } assertEquals(6, iter.previous()); assertEquals(5, iter.previous()); assertEquals(4, iter.previous()); assertEquals(3, iter.previous()); assertEquals(2, iter.previous()); assertEquals(1, iter.previous()); try { iter.previous(); Assert.fail(); } catch (NoSuchElementException e) { } assertEquals(1, iter.next()); assertEquals(2, iter.next()); assertEquals(3, iter.next()); assertEquals(4, iter.next()); assertEquals(4, iter.previous()); assertEquals(3, iter.previous()); assertEquals(2, iter.previous()); assertEquals(1, iter.previous()); }