### Question:
JexlNodeSet implements Set<JexlNode> { @Override public Iterator<JexlNode> iterator() { return Collections.unmodifiableCollection(nodeMap.values()).iterator(); } JexlNodeSet();  JexlNodeSet(boolean useSourceNodeForKeys); Collection<JexlNode> getNodes(); Set<String> getNodeKeys(); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override Iterator<JexlNode> iterator(); @Override Object[] toArray(); @Override T[] toArray(T[] ts); @Override boolean add(JexlNode node); @Override boolean remove(Object o); @Override boolean containsAll(Collection<?> collection); @Override boolean addAll(Collection<? extends JexlNode> collection); @Override boolean retainAll(Collection<?> collection); @Override boolean removeAll(Collection<?> collection); @Override void clear(); String buildKey(JexlNode node); @Override boolean equals(Object o); @Override int hashCode();  }### Answer:
@Test public void testIterator() { JexlNode node = JexlNodeFactory.buildEQNode("FOO", "bar"); JexlNodeSet nodeSet = new JexlNodeSet(); nodeSet.add(node); Iterator<JexlNode> iter = nodeSet.iterator(); assertTrue(iter.hasNext()); JexlNode next = iter.next(); assertEquals(JexlASTHelper.nodeToKey(node), JexlASTHelper.nodeToKey(next)); assertFalse(iter.hasNext()); }