ResettableSingletonTraverser implements Traverser<T>, Consumer<T> { @Override public T next() { try { return item; } finally { item = null; } }  @Override T next(); @Override void accept(@Nullable T item);  }
@Test public void when_acceptNotCalled_thenNextReturnsNull() { Integer item = trav.next(); assertNull(item); }