class IdRangeIterator implements IdSequence {

    @Override
    public long nextId()
    {
        try
        {
            if ( position < defrag.length )
            {
                return defrag[position];
            }

            long candidate = nextRangeCandidate();
            if ( IdValidator.isReservedId( candidate ) )
            {
                position++;
                candidate = nextRangeCandidate();
            }
            return candidate;
        }
        finally
        {
            ++position;
        }
    }

    public  IdRangeIterator( IdRange idRange );

}