@Test
public void testMakeNextReturnsNull() {

    final Iterator<Object> iter = new AbstractIterator<Object>() {
        @Nullable
        @Override
        protected Object makeNext() {
            return null;
        }
    };
    assertThat(iter.hasNext()).isTrue();
    assertThatThrownBy(iter::next)
            .isInstanceOf(IllegalStateException.class)
            .hasMessage("expected item but none found");
}