### Question:
BlockStorage implements Closeable { void doneAdding() throws IOException { if ( !bufferedEntries.isEmpty() ) { flushAndResetBuffer(); numberOfBlocksInCurrentFile++; } doneAdding = true; storeChannel.close(); } BlockStorage( Layout<KEY,VALUE> layout, ByteBufferFactory bufferFactory, FileSystemAbstraction fs, File blockFile, Monitor monitor ); void add( KEY key, VALUE value ); void merge( int mergeFactor, Cancellation cancellation ); @Override void close();  }### Answer:
@Test void shouldNotFlushAnythingOnEmptyBufferInDoneAdding() throws IOException { TrackingMonitor monitor = new TrackingMonitor(); try ( BlockStorage<MutableLong,MutableLong> storage = new BlockStorage<>( layout, heapBufferFactory( 100 ), fileSystem, file, monitor ) ) { storage.doneAdding(); assertEquals( 0, monitor.blockFlushedCallCount ); } }