public static ChannelBuffer directBuffer(int capacity) {
        if (capacity == 0) {
            return EMPTY_BUFFER;
        }

        ChannelBuffer buffer = new ByteBufferBackedChannelBuffer(ByteBuffer.allocateDirect(capacity));
        buffer.clear();
        return buffer;
    }
@Test
    void testDirectBuffer() {
        ChannelBuffer channelBuffer = ChannelBuffers.directBuffer(0);
        Assertions.assertEquals(channelBuffer, EMPTY_BUFFER);

        channelBuffer = ChannelBuffers.directBuffer(16);
        Assertions.assertTrue(channelBuffer instanceof ByteBufferBackedChannelBuffer);
    }