### Question:
TrieMap implements Iterable<T> { public Iterator<T> iterator() { if (root == null) { return new Iterator<T>() { @Override public boolean hasNext() { return false; } @Override public T next() { throw new NoSuchElementException(); } @Override public void remove() { throw new UnsupportedOperationException(); } }; } else { return root.iterator(); } }  void put(CharSequence seq, T value); Iterator<T> iterator(); void putPrefix(CharSequence seq, T value); States<T> get(CharSequence seq); States<T> get(CharSequence seq, State<T> stateInfo);  }### Answer:
@Test public void testValueIteratorEmptyMap() throws Exception { TrieMap<Integer> map = new TrieMap<Integer>(); Iterator<Integer> it = map.iterator(); assertFalse(it.hasNext()); try { it.next(); fail("NoSuchElementException expected"); } catch (NoSuchElementException e) { } }