### Question:
PooledBufferAllocatorImpl extends org.embulk.deps.buffer.PooledBufferAllocator { @Override public Buffer allocate() { return allocate(this.pageSize); } PooledBufferAllocatorImpl(final int pageSize); @Override Buffer allocate(); @Override Buffer allocate(final int minimumCapacity);  }### Answer:
@Test public void testDefault() throws Exception { final PooledBufferAllocatorImpl allocator = new PooledBufferAllocatorImpl(4096); final Buffer buffer = allocator.allocate(); assertEquals(0, buffer.offset()); assertEquals(0, buffer.limit()); assertEquals(4096, buffer.capacity()); buffer.release(); }
@Test public void testWithBiggerMinimumCapacity() throws Exception { final PooledBufferAllocatorImpl allocator = new PooledBufferAllocatorImpl(4096); final Buffer buffer = allocator.allocate(10000); assertEquals(0, buffer.offset()); assertEquals(0, buffer.limit()); assertEquals(16384, buffer.capacity()); buffer.release(); }
@Test public void testDoubleRelease() throws Exception { final PooledBufferAllocatorImpl allocator = new PooledBufferAllocatorImpl(4096); final Buffer buffer = allocator.allocate(10000); buffer.release(); buffer.release(); }