@Test
ublic void callingCompletedReleasesActions() {

   // given
   BufferedBulk.Builder builder = createDefaultTestMockedBuilder();
   ByteBufItemSource buffer = mock(ByteBufItemSource.class);
   builder.withBuffer(buffer);
   BufferedBulk bulk = builder.build();
   List<BulkableAction> actions = new ArrayList<>();
   BufferedIndex bufferedIndex = spy(new BufferedIndex.Builder(mock(ByteBufItemSource.class)).build());
   actions.add(bufferedIndex);
   builder.addAction(actions);
   // when
   bulk.completed();
   // then
   verify(bufferedIndex).release();
}