@Test public void poppingFromStack_modificationUnderneath() {

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