### Question:
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 ); @Override synchronized void close(); @Override long nextId(); @Override IdRange nextIdBatch( int size );  }### Answer:
@Test public void shouldHandleCloseWithNoCurrentBatch() { ids.close(); assertTrue( excessIds.isEmpty() ); }