BitSet getVersionsLeading( int index )
    {
        BitSet bs = new BitSet();
        if ( index == pairs.size()-1 )
        {
            for ( int i=0;i<versions.size();i++ )
                bs.set( i+1 );
        }
        else
        {
            Pair p1 = pairs.get( index );
            Pair p2 = pairs.get( index+1 );
            bs.or( p1.versions );
            bs.or( p2.versions );
            for ( int i=index+1;i<pairs.size();i++ )
            {
                Pair q2 = pairs.get( i );
                Pair q1 = pairs.get( i-1 );
                if ( q2.isHint() || q2.versions.intersects(q1.versions) )
                    break;
                bs.or( q2.versions );
            }
        }
        return bs;
    }