@Test
public void createRemovesFromPool() throws PoolResourceException {

    // given
    ItemSourcePool mockedPool = mock(ItemSourcePool.class);
    ByteBuf byteBuf = createDefaultTestByteBuf();
    ItemSource<ByteBuf> bufferedItemSource = new ByteBufItemSource(byteBuf, source -> {});
    when(mockedPool.getPooled()).thenReturn(bufferedItemSource);
    PooledItemSourceFactory pooledItemSourceFactory = new PooledItemSourceFactory(mockedPool);
    // when
    pooledItemSourceFactory.create(mock(LogEvent.class), new ObjectMapper().writerFor(LogEvent.class));
    // then
    verify(mockedPool).getPooled();
}