@Test public void removingFromQueue_modificationUnderneath() {

  Queue<String> queue = new ArrayDeque<>();
  Stream<String> stream = whileNotNull(queue::poll);
  queue.add("one");
  queue.add("two");
  assertThat(stream).containsExactly("one", "two").inOrder();
  assertThat(queue).isEmpty();
}