### Question:
ParameterValueList implements Collection<ParameterValue> { @Override public Iterator<ParameterValue> iterator() { return new Iter(); } ParameterValueList();  ParameterValueList(Collection<ParameterValue> pvs);   ParameterValueList(int capacity, Collection<ParameterValue> pvs); @Override boolean add(ParameterValue pv); int count(Parameter p); int getSize(); ParameterValue getLastInserted(Parameter p); ParameterValue getFirstInserted(Parameter p); void forEach(Parameter p, Consumer<ParameterValue> action); ParameterValue removeLast(Parameter p); ParameterValue removeFirst(Parameter p); @Override Iterator<ParameterValue> iterator(); @Override boolean addAll(Collection<? extends ParameterValue> c); @Override void clear(); @Override boolean contains(Object o); @Override boolean containsAll(Collection<?> c); @Override boolean isEmpty(); @Override boolean remove(Object o); @Override boolean removeAll(Collection<?> c); @Override boolean retainAll(Collection<?> c); @Override int size(); @Override Object[] toArray(); @Override T[] toArray(T[] a); String toString();  }### Answer:
@Test public void testIterator() { Parameter p = new Parameter("p1"); ParameterValue pv1 = new ParameterValue(p); pv1.setStringValue("pv1"); ParameterValue pv2 = new ParameterValue(p); pv2.setStringValue("pv2"); ParameterValueList pvlist = new ParameterValueList(); Iterator<ParameterValue> it = pvlist.iterator(); assertFalse(it.hasNext()); pvlist.add(pv1); it = pvlist.iterator(); assertTrue(it.hasNext()); assertEquals(pv1, it.next()); assertFalse(it.hasNext()); pvlist.removeFirst(p); pvlist.add(pv2); pvlist.add(pv1); it = pvlist.iterator(); assertTrue(it.hasNext()); assertEquals(pv2, it.next()); assertTrue(it.hasNext()); assertEquals(pv1, it.next()); assertFalse(it.hasNext()); }