### Question:
ApproxStringIntMap implements Iterable<Pair<String, Integer>> { public Iterator<Pair<String, Integer>> iterator() { return new StringIntMapIterator(this); } ApproxStringIntMap(StringStack dictionary); int size(); boolean isEmpty(); boolean containsKey(String key); int get(String key); int put(String key, int value); int addTo(String key, int amount); int remove(String key); void clear(); Iterator<Pair<String, Integer>> iterator();  }### Answer:
@Test public void testIterator() { asim.put("moo", 1); asim.put("far", 2); Iterator<Pair<String, Integer>> pairs = asim.iterator(); assertTrue(pairs.hasNext()); assertEquals(Pair.of("moo", 1), pairs.next()); assertTrue(pairs.hasNext()); assertEquals(Pair.of("far", 2), pairs.next()); assertFalse(pairs.hasNext()); }