OpenIntToDoubleHashMap implements Serializable { public Iterator iterator() { return new Iterator(); } OpenIntToDoubleHashMap();  OpenIntToDoubleHashMap(final double missingEntries);  OpenIntToDoubleHashMap(final int expectedSize);  OpenIntToDoubleHashMap(final int expectedSize,
                                  final double missingEntries);  OpenIntToDoubleHashMap(final OpenIntToDoubleHashMap source); double get(final int key); boolean containsKey(final int key); Iterator iterator(); int size(); double remove(final int key); double put(final int key, final double value);  }
@Test public void testIterator() { OpenIntToDoubleHashMap map = createFromJavaMap(); OpenIntToDoubleHashMap.Iterator iterator = map.iterator(); for (int i = 0; i < map.size(); ++i) { Assert.assertTrue(iterator.hasNext()); iterator.advance(); int key = iterator.key(); Assert.assertTrue(map.containsKey(key)); Assert.assertEquals(javaMap.get(key), map.get(key), 0); Assert.assertEquals(javaMap.get(key), iterator.value(), 0); Assert.assertTrue(javaMap.containsKey(key)); } Assert.assertFalse(iterator.hasNext()); try { iterator.advance(); Assert.fail("an exception should have been thrown"); } catch (NoSuchElementException nsee) { } }