assertEquals( 3, position[ 3 ] );
assertEquals( Interval.valueOf( 3 ), multiTermIndexIterator.intervalIterator().nextInterval() );
IntIterator positions = multiTermIndexIterator.positions();
assertEquals( 0, positions.nextInt() );
assertEquals( 1, positions.nextInt() );
assertEquals( 2, positions.nextInt() );
assertEquals( 3, positions.nextInt() );
assertFalse( positions.hasNext() );
assertFalse( multiTermIndexIterator.intervalIterator().hasNext() );
assertFalse( multiTermIndexIterator.intervalIterator().hasNext() ); // To increase coverage
assertEquals( 1, multiTermIndexIterator.nextDocument() );
assertTrue( multiTermIndexIterator.intervalIterator().hasNext() );
assertTrue( multiTermIndexIterator.intervalIterator().hasNext() ); // To increase coverage
assertEquals( Interval.valueOf( 0 ), multiTermIndexIterator.intervalIterator().nextInterval() );
assertEquals( Interval.valueOf( 2 ), multiTermIndexIterator.intervalIterator().nextInterval() );
assertEquals( 2, multiTermIndexIterator.count() );
position = multiTermIndexIterator.positionArray();
assertEquals( 0, position[ 0 ] );
assertEquals( 2, position[ 1 ] );
positions = multiTermIndexIterator.positions();
assertEquals( 0, positions.nextInt() );
assertEquals( 2, positions.nextInt() );
assertFalse( positions.hasNext() );
assertFalse( multiTermIndexIterator.intervalIterator().hasNext() );
assertEquals( 2, multiTermIndexIterator.nextDocument() );
assertTrue( multiTermIndexIterator.intervalIterator().hasNext() );
assertTrue( multiTermIndexIterator.intervalIterator().hasNext() ); // To increase coverage
assertEquals( Interval.valueOf( 0 ), multiTermIndexIterator.intervalIterator().nextInterval() );
assertEquals( Interval.valueOf( 1 ), multiTermIndexIterator.intervalIterator().nextInterval() );
assertEquals( 2, multiTermIndexIterator.count() );
position = multiTermIndexIterator.positionArray();
assertEquals( 0, position[ 0 ] );
assertEquals( 1, position[ 1 ] );
positions = multiTermIndexIterator.positions();
assertEquals( 0, positions.nextInt() );
assertEquals( 1, positions.nextInt() );
assertFalse( positions.hasNext() );
assertFalse( multiTermIndexIterator.intervalIterator().hasNext() );
// Here we get the iterator of the underlying IndexIterator
assertEquals( 3, multiTermIndexIterator.nextDocument() );
assertTrue( multiTermIndexIterator.intervalIterator().hasNext() );
assertEquals( Interval.valueOf( 0 ), multiTermIndexIterator.intervalIterator().nextInterval() );
assertEquals( 1, multiTermIndexIterator.count() );
position = multiTermIndexIterator.positionArray();
assertEquals( 0, position[ 0 ] );
positions = multiTermIndexIterator.positions();
assertEquals( 0, positions.nextInt() );
assertFalse( positions.hasNext() );
assertFalse( multiTermIndexIterator.intervalIterator().hasNext() );
// The end
assertFalse( multiTermIndexIterator.hasNext() );