private void injectNetworkReceive(KafkaChannel channel, int size) throws Exception {
        NetworkReceive receive = new NetworkReceive();
        TestUtils.setFieldValue(channel, "receive", receive);
        ByteBuffer sizeBuffer = TestUtils.fieldValue(receive, NetworkReceive.class, "size");
        sizeBuffer.putInt(size);
        TestUtils.setFieldValue(receive, "buffer", ByteBuffer.allocate(size));
    }
Injects a NetworkReceive for channel with size buffer filled in with the provided size
and a payload buffer allocated with that size, but no data in the payload buffer.
clients/src/test/java/org/apache/kafka/common/network/SelectorTest.java