ConfigItemSet implements ConfigItemCollection<ConfigBlock> { @Override public Iterator<ConfigBlock> iterator() { return this.blockByName.values().iterator(); } ConfigItemSet(final String name); @Override String getName(); @Override void appendXMLContent(final XMLUtil util, final Appendable appendable); @Override int size(); @Override boolean isEmpty(); @Override Iterator<ConfigBlock> iterator(); void add(final ConfigBlock configBlock); boolean contains(final String name); void removeByName(final String name); ConfigBlock getByName(final String name);  }
@Test public void testIterator() { final ConfigItemSet m = new ConfigItemSet("set"); m.add(this.item); final Iterator<ConfigBlock> i = m.iterator(); Assert.assertTrue(i.hasNext()); Assert.assertEquals(this.item, i.next()); Assert.assertFalse(i.hasNext()); }