### Question:
BatchChain implements Iterable<Batch> { public void add(final Batch batch) { checkNotNull(batch, "Cannot add null batch to BatchChain"); batches.add(batch); }  NavigableSet<Batch> batchesBeforeInclusive(final Batch batch); NavigableSet<Batch> batchesBeforeExclusive(final Batch batch); void add(final Batch batch); NavigableSet<Batch> batchesAfterInclusive(final Batch batch); NavigableSet<Batch> batchesAfterExclusive(final Batch batch); NavigableSet<Batch> batchesBetweenInclusive(final Batch from, final Batch to); NavigableSet<Batch> batchesBetweenExclusive(final Batch from, final Batch to); Optional<Batch> previousNonEmptyBatch(final Batch batch); Optional<Batch> nextNonEmptyBatch(final Batch batch); Optional<Batch> firstImportableBatch(); void removeUpToIncluding(final Batch batch); void removeAll(); Optional<Batch> last(); boolean contains(final Batch batch); boolean isEmpty(); @Override Iterator<Batch> iterator(); @Override void forEach(final Consumer<? super Batch> action); @Override Spliterator<Batch> spliterator(); Stream<Batch> stream();  }### Answer:
@Test void iterator_shouldIterateAllItems() { final Batch batch1 = createBatch(1); final Batch batch2 = createBatch(2); final Batch batch3 = createBatch(3); final Batch batch4 = createBatch(4); batchChain.add(batch1); batchChain.add(batch2); batchChain.add(batch3); batchChain.add(batch4); assertThat(batchChain).containsExactly(batch1, batch2, batch3, batch4); }