### Question:
DynamicRecordListImpl implements DynamicRecordList { @Override public Iterator<Record> iterator() { return records.iterator(); } DynamicRecordListImpl(final Structure structure, final Record parent);   DynamicRecordListImpl(final Structure structure, final Record parent, final RecordImplFactory recordFactory); @Override Record addItem(); @Override List<Record> getAll(); @Override Record get(final int index); @Override int getSize(); @Override Structure getStructure(); @Override void removeItem(final Record item); @Override void removeItem(final int index); @Override Iterator<Record> iterator();  }### Answer:
@Test public void testIterator() { final Record record = mock(Record.class); final RecordImplFactory factory = mock(RecordImplFactory.class); when(factory.createNestedRecord(STRUCTURE, PARENT)).thenReturn(record); final DynamicRecordListImpl list = new DynamicRecordListImpl(STRUCTURE, PARENT, factory); assertThat(list.addItem()).isEqualTo(record); final Iterator<Record> iterator = list.iterator(); assertThat(iterator.hasNext()).isTrue(); assertThat(iterator.next()).isSameAs(record); }