### Question:
Iteration { public final Stream<T> iterate() { if (started.getAndSet(true)) { throw new IllegalStateException("Iteration already started."); } return whileNotNull(this::next); }  final Iteration<T> yield(T element); final Iteration<T> yield(Continuation continuation); final Iteration<T> yield(
      Supplier<? extends T> computation, Consumer<? super T> consumer); final Stream<T> iterate();  }### Answer:
@Test public void iteration_empty() { assertThat(new Iteration<Object>().iterate()).isEmpty(); }
@Test public void oneTimeIteration() { DepthFirst<String> iteration = new DepthFirst<>(); iteration.iterate(); assertThrows(IllegalStateException.class, iteration::iterate); }