@Test
  public void testSingleRequestAllocateDeallocate() throws Exception {
    final long capacity = 2 * 1024;
    final int size = 1024;
    long maxBlockTimeInMs = 200;
    SimpleByteBufferPool pool = new SimpleByteBufferPool(capacity);
    assertEquals(capacity, pool.availableMemory());
    ByteBuffer buffer = pool.allocate(size, maxBlockTimeInMs);
    assertEquals(size, buffer.capacity());
    assertEquals(capacity - size, pool.availableMemory());
    pool.deallocate(buffer);
    assertEquals(capacity, pool.availableMemory());
  }
This is a simple scenario where the {@link SimpleByteBufferPool} has enough buffer to allocate a certain amount
of {@link ByteBuffer}, and then deallocated the same amount of {@link ByteBuffer} back to the buffer pool. No
error should occur during this test.
ambry-utils/src/test/java/com/github/ambry/utils/SimpleByteBufferPoolTest.java