Query query = simpleParser.parse( "(a|b|d)<(a|b|d)" );
DocumentIteratorBuilderVisitor documentIteratorBuilderVisitor = new DocumentIteratorBuilderVisitor( null, index, Integer.MAX_VALUE );
DocumentIterator documentIterator = query.accept( documentIteratorBuilderVisitor );
documentIterator.nextDocument();
IntervalIterator intervalIterator = documentIterator.intervalIterator();
assertEquals( Interval.valueOf( 0, 1 ), intervalIterator.nextInterval() );
assertEquals( Interval.valueOf( 1, 2 ), intervalIterator.nextInterval() );
assertEquals( Interval.valueOf( 2, 4 ), intervalIterator.nextInterval() );
assertFalse( intervalIterator.hasNext() );
documentIterator.dispose();
}