### Question:
IteratorSourceStage implements Stage { @Override public void run() { while (pipe.isOpen() && source.hasNext()) { final T value = source.next(); if (value != null) { pipe.put(value); } } pipe.close(); } IteratorSourceStage(final String name, final Iterator<T> source, final Pipe<T> pipe); @Override void run(); @Override String getName();  }### Answer:
@Test public void shouldOutputEntriesThenClosePipe() { stage.run(); assertThat(output.isOpen()).isFalse(); assertThat(output.hasMore()).isTrue(); assertThat(output.get()).isEqualTo("a"); assertThat(output.hasMore()).isTrue(); assertThat(output.get()).isEqualTo("b"); assertThat(output.hasMore()).isTrue(); assertThat(output.get()).isEqualTo("c"); assertThat(output.hasMore()).isTrue(); assertThat(output.get()).isEqualTo("d"); assertThat(output.hasMore()).isFalse(); }