Implementations of DocIdSetIterator behave differently when advanced is called. Taking the following test for OpenBitSet, DocIdBitSet and SortedVIntList only SortedVIntList passes the test:
The javadoc for advance says:
Advances to the first beyond the current whose document number is greater than or equal to target.
This seems to indicate that SortedVIntList behaves correctly, whereas the other two don't.
Just looking at the DocIdBitSet implementation advance is implemented as:
where the docs of nextSetBit say:
Returns the index of the first bit that is set to true that occurs on or after the specified starting index