@Test public void removingFromQueue_modificationWhileStreaming() {

  Queue<String> queue = new ArrayDeque<>();
  queue.add("one");
  assertThat(
          whileNotNull(queue::poll)
              .peek(v -> {
                if (v.equals("one")) queue.add("two");
              }))
      .containsExactly("one", "two").inOrder();
  assertThat(queue).isEmpty();
}