class RenewableBatchIdSequence implements IdSequence, Resource {

    @Override
    public synchronized void close()
    {
        if ( !closed && currentBatch != null )
        {
            long id;
            while ( (id = currentBatch.nextId()) != VALUE_REPRESENTING_NULL )
            {
                excessIdConsumer.accept( id );
            }
            currentBatch = null;
        }
        closed = true;
    }

      RenewableBatchIdSequence( IdSequence source, int batchSize, LongConsumer excessIdConsumer );

}