class NativeDistinctValuesProgressor extends NativeIndexProgressor<KEY,VALUE> {

    @Override
    public boolean next()
    {
        try
        {
            while ( seeker.next() )
            {
                KEY key = seeker.get().key();
                if ( first )
                {
                    first = false;
                    countForCurrentValue = 1;
                    layout.copyKey( key, prev );
                }
                else if ( comparator.compare( prev, key ) == 0 )
                {
                    // same as previous
                    countForCurrentValue++;
                }
                else
                {
                    // different from previous
                    boolean accepted = client.acceptNode( countForCurrentValue, extractValues( prev ) );
                    countForCurrentValue = 1;
                    layout.copyKey( key, prev );
                    if ( accepted )
                    {
                        return true;
                    }
                }
            }
            boolean finalResult = !first && !last && client.acceptNode( countForCurrentValue, extractValues( prev ) );
            last = true;
            return finalResult;
        }
        catch ( IOException e )
        {
            throw new UncheckedIOException( e );
        }
    }

      NativeDistinctValuesProgressor( RawCursor<Hit<KEY,VALUE>,IOException> seeker, NodeValueClient client,
            Collection<RawCursor<Hit<KEY,VALUE>,IOException>> toRemoveFromOnClose, IndexLayout<KEY,VALUE> layout,
            Comparator<KEY> comparator );

}