SqlPartIterator implements Iterator<SqlPart> { @Override public boolean hasNext() { return mLastReturned == null || mLastReturned.previous() != null; } SqlPartIterator(@NotNull final SqlPart first); @Override boolean hasNext(); @Override SqlPart next(); @Override void remove();  }
@Test public void immediateHasNext_returnsTrue() { SqlPartIterator iterator = new SqlPartIterator(mock(SqlPart.class)); boolean result = iterator.hasNext(); assertThat(result, is(true)); }