### Question:
CronetWritableBufferAllocator implements WritableBufferAllocator { @Override public WritableBuffer allocate(int capacityHint) { capacityHint = Math.min(MAX_BUFFER, capacityHint); return new CronetWritableBuffer(ByteBuffer.allocateDirect(capacityHint), capacityHint); } CronetWritableBufferAllocator(); @Override WritableBuffer allocate(int capacityHint);  }### Answer:
@Test public void testAllocate() throws Exception { CronetWritableBufferAllocator allocator = new CronetWritableBufferAllocator(); WritableBuffer buffer = allocator.allocate(1000); assertEquals(1000, buffer.writableBytes()); }
@Test public void testAllocateLargeBuffer() throws Exception { CronetWritableBufferAllocator allocator = new CronetWritableBufferAllocator(); WritableBuffer buffer = allocator.allocate(1024 * 1024 * 1024); assertEquals(1024 * 1024, buffer.writableBytes()); }